proteus  1.8.0
C/C++/Fortran libraries
csmoothers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.24 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_24"
13 #define CYTHON_HEX_VERSION 0x001D18F0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89  #define CYTHON_COMPILING_IN_PYPY 0
90  #define CYTHON_COMPILING_IN_PYSTON 1
91  #define CYTHON_COMPILING_IN_CPYTHON 0
92  #ifndef CYTHON_USE_TYPE_SLOTS
93  #define CYTHON_USE_TYPE_SLOTS 1
94  #endif
95  #undef CYTHON_USE_PYTYPE_LOOKUP
96  #define CYTHON_USE_PYTYPE_LOOKUP 0
97  #undef CYTHON_USE_ASYNC_SLOTS
98  #define CYTHON_USE_ASYNC_SLOTS 0
99  #undef CYTHON_USE_PYLIST_INTERNALS
100  #define CYTHON_USE_PYLIST_INTERNALS 0
101  #ifndef CYTHON_USE_UNICODE_INTERNALS
102  #define CYTHON_USE_UNICODE_INTERNALS 1
103  #endif
104  #undef CYTHON_USE_UNICODE_WRITER
105  #define CYTHON_USE_UNICODE_WRITER 0
106  #undef CYTHON_USE_PYLONG_INTERNALS
107  #define CYTHON_USE_PYLONG_INTERNALS 0
108  #ifndef CYTHON_AVOID_BORROWED_REFS
109  #define CYTHON_AVOID_BORROWED_REFS 0
110  #endif
111  #ifndef CYTHON_ASSUME_SAFE_MACROS
112  #define CYTHON_ASSUME_SAFE_MACROS 1
113  #endif
114  #ifndef CYTHON_UNPACK_METHODS
115  #define CYTHON_UNPACK_METHODS 1
116  #endif
117  #undef CYTHON_FAST_THREAD_STATE
118  #define CYTHON_FAST_THREAD_STATE 0
119  #undef CYTHON_FAST_PYCALL
120  #define CYTHON_FAST_PYCALL 0
121  #undef CYTHON_PEP489_MULTI_PHASE_INIT
122  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123  #undef CYTHON_USE_TP_FINALIZE
124  #define CYTHON_USE_TP_FINALIZE 0
125  #undef CYTHON_USE_DICT_VERSIONS
126  #define CYTHON_USE_DICT_VERSIONS 0
127  #undef CYTHON_USE_EXC_INFO_STACK
128  #define CYTHON_USE_EXC_INFO_STACK 0
129 #else
130  #define CYTHON_COMPILING_IN_PYPY 0
131  #define CYTHON_COMPILING_IN_PYSTON 0
132  #define CYTHON_COMPILING_IN_CPYTHON 1
133  #ifndef CYTHON_USE_TYPE_SLOTS
134  #define CYTHON_USE_TYPE_SLOTS 1
135  #endif
136  #if PY_VERSION_HEX < 0x02070000
137  #undef CYTHON_USE_PYTYPE_LOOKUP
138  #define CYTHON_USE_PYTYPE_LOOKUP 0
139  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140  #define CYTHON_USE_PYTYPE_LOOKUP 1
141  #endif
142  #if PY_MAJOR_VERSION < 3
143  #undef CYTHON_USE_ASYNC_SLOTS
144  #define CYTHON_USE_ASYNC_SLOTS 0
145  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146  #define CYTHON_USE_ASYNC_SLOTS 1
147  #endif
148  #if PY_VERSION_HEX < 0x02070000
149  #undef CYTHON_USE_PYLONG_INTERNALS
150  #define CYTHON_USE_PYLONG_INTERNALS 0
151  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152  #define CYTHON_USE_PYLONG_INTERNALS 1
153  #endif
154  #ifndef CYTHON_USE_PYLIST_INTERNALS
155  #define CYTHON_USE_PYLIST_INTERNALS 1
156  #endif
157  #ifndef CYTHON_USE_UNICODE_INTERNALS
158  #define CYTHON_USE_UNICODE_INTERNALS 1
159  #endif
160  #if PY_VERSION_HEX < 0x030300F0
161  #undef CYTHON_USE_UNICODE_WRITER
162  #define CYTHON_USE_UNICODE_WRITER 0
163  #elif !defined(CYTHON_USE_UNICODE_WRITER)
164  #define CYTHON_USE_UNICODE_WRITER 1
165  #endif
166  #ifndef CYTHON_AVOID_BORROWED_REFS
167  #define CYTHON_AVOID_BORROWED_REFS 0
168  #endif
169  #ifndef CYTHON_ASSUME_SAFE_MACROS
170  #define CYTHON_ASSUME_SAFE_MACROS 1
171  #endif
172  #ifndef CYTHON_UNPACK_METHODS
173  #define CYTHON_UNPACK_METHODS 1
174  #endif
175  #ifndef CYTHON_FAST_THREAD_STATE
176  #define CYTHON_FAST_THREAD_STATE 1
177  #endif
178  #ifndef CYTHON_FAST_PYCALL
179  #define CYTHON_FAST_PYCALL 1
180  #endif
181  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
183  #endif
184  #ifndef CYTHON_USE_TP_FINALIZE
185  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
186  #endif
187  #ifndef CYTHON_USE_DICT_VERSIONS
188  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
189  #endif
190  #ifndef CYTHON_USE_EXC_INFO_STACK
191  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192  #endif
193 #endif
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
196 #endif
197 #if CYTHON_USE_PYLONG_INTERNALS
198  #include "longintrepr.h"
199  #undef SHIFT
200  #undef BASE
201  #undef MASK
202  #ifdef SIZEOF_VOID_P
203  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
204  #endif
205 #endif
206 #ifndef __has_attribute
207  #define __has_attribute(x) 0
208 #endif
209 #ifndef __has_cpp_attribute
210  #define __has_cpp_attribute(x) 0
211 #endif
212 #ifndef CYTHON_RESTRICT
213  #if defined(__GNUC__)
214  #define CYTHON_RESTRICT __restrict__
215  #elif defined(_MSC_VER) && _MSC_VER >= 1400
216  #define CYTHON_RESTRICT __restrict
217  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218  #define CYTHON_RESTRICT restrict
219  #else
220  #define CYTHON_RESTRICT
221  #endif
222 #endif
223 #ifndef CYTHON_UNUSED
224 # if defined(__GNUC__)
225 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226 # define CYTHON_UNUSED __attribute__ ((__unused__))
227 # else
228 # define CYTHON_UNUSED
229 # endif
230 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231 # define CYTHON_UNUSED __attribute__ ((__unused__))
232 # else
233 # define CYTHON_UNUSED
234 # endif
235 #endif
236 #ifndef CYTHON_MAYBE_UNUSED_VAR
237 # if defined(__cplusplus)
238  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
239 # else
240 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 # endif
242 #endif
243 #ifndef CYTHON_NCP_UNUSED
244 # if CYTHON_COMPILING_IN_CPYTHON
245 # define CYTHON_NCP_UNUSED
246 # else
247 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 # endif
249 #endif
250 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
251 #ifdef _MSC_VER
252  #ifndef _MSC_STDINT_H_
253  #if _MSC_VER < 1300
254  typedef unsigned char uint8_t;
255  typedef unsigned int uint32_t;
256  #else
257  typedef unsigned __int8 uint8_t;
258  typedef unsigned __int32 uint32_t;
259  #endif
260  #endif
261 #else
262  #include <stdint.h>
263 #endif
264 #ifndef CYTHON_FALLTHROUGH
265  #if defined(__cplusplus) && __cplusplus >= 201103L
266  #if __has_cpp_attribute(fallthrough)
267  #define CYTHON_FALLTHROUGH [[fallthrough]]
268  #elif __has_cpp_attribute(clang::fallthrough)
269  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270  #elif __has_cpp_attribute(gnu::fallthrough)
271  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272  #endif
273  #endif
274  #ifndef CYTHON_FALLTHROUGH
275  #if __has_attribute(fallthrough)
276  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
277  #else
278  #define CYTHON_FALLTHROUGH
279  #endif
280  #endif
281  #if defined(__clang__ ) && defined(__apple_build_version__)
282  #if __apple_build_version__ < 7000000
283  #undef CYTHON_FALLTHROUGH
284  #define CYTHON_FALLTHROUGH
285  #endif
286  #endif
287 #endif
288 
289 #ifndef CYTHON_INLINE
290  #if defined(__clang__)
291  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
292  #elif defined(__GNUC__)
293  #define CYTHON_INLINE __inline__
294  #elif defined(_MSC_VER)
295  #define CYTHON_INLINE __inline
296  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
297  #define CYTHON_INLINE inline
298  #else
299  #define CYTHON_INLINE
300  #endif
301 #endif
302 
303 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
304  #define Py_OptimizeFlag 0
305 #endif
306 #define __PYX_BUILD_PY_SSIZE_T "n"
307 #define CYTHON_FORMAT_SSIZE_T "z"
308 #if PY_MAJOR_VERSION < 3
309  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
310  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
311  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
312  #define __Pyx_DefaultClassType PyClass_Type
313 #else
314  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
315 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
316  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
317  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
318 #else
319  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
320  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
321 #endif
322  #define __Pyx_DefaultClassType PyType_Type
323 #endif
324 #ifndef Py_TPFLAGS_CHECKTYPES
325  #define Py_TPFLAGS_CHECKTYPES 0
326 #endif
327 #ifndef Py_TPFLAGS_HAVE_INDEX
328  #define Py_TPFLAGS_HAVE_INDEX 0
329 #endif
330 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
331  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
332 #endif
333 #ifndef Py_TPFLAGS_HAVE_FINALIZE
334  #define Py_TPFLAGS_HAVE_FINALIZE 0
335 #endif
336 #ifndef METH_STACKLESS
337  #define METH_STACKLESS 0
338 #endif
339 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
340  #ifndef METH_FASTCALL
341  #define METH_FASTCALL 0x80
342  #endif
343  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
344  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
345  Py_ssize_t nargs, PyObject *kwnames);
346 #else
347  #define __Pyx_PyCFunctionFast _PyCFunctionFast
348  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
349 #endif
350 #if CYTHON_FAST_PYCCALL
351 #define __Pyx_PyFastCFunction_Check(func)\
352  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
353 #else
354 #define __Pyx_PyFastCFunction_Check(func) 0
355 #endif
356 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
357  #define PyObject_Malloc(s) PyMem_Malloc(s)
358  #define PyObject_Free(p) PyMem_Free(p)
359  #define PyObject_Realloc(p) PyMem_Realloc(p)
360 #endif
361 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
362  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
363  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
364  #define PyMem_RawFree(p) PyMem_Free(p)
365 #endif
366 #if CYTHON_COMPILING_IN_PYSTON
367  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
368  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
369 #else
370  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
371  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
372 #endif
373 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
374  #define __Pyx_PyThreadState_Current PyThreadState_GET()
375 #elif PY_VERSION_HEX >= 0x03060000
376  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
377 #elif PY_VERSION_HEX >= 0x03000000
378  #define __Pyx_PyThreadState_Current PyThreadState_GET()
379 #else
380  #define __Pyx_PyThreadState_Current _PyThreadState_Current
381 #endif
382 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
383 #include "pythread.h"
384 #define Py_tss_NEEDS_INIT 0
385 typedef int Py_tss_t;
386 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
387  *key = PyThread_create_key();
388  return 0;
389 }
390 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
391  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
392  *key = Py_tss_NEEDS_INIT;
393  return key;
394 }
395 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
396  PyObject_Free(key);
397 }
398 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
399  return *key != Py_tss_NEEDS_INIT;
400 }
401 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
402  PyThread_delete_key(*key);
403  *key = Py_tss_NEEDS_INIT;
404 }
405 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
406  return PyThread_set_key_value(*key, value);
407 }
408 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
409  return PyThread_get_key_value(*key);
410 }
411 #endif
412 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
413 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
414 #else
415 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
416 #endif
417 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
418  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
419  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
420 #else
421  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
422  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
423 #endif
424 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
425 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
426 #else
427 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
428 #endif
429 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
430  #define CYTHON_PEP393_ENABLED 1
431  #if defined(PyUnicode_IS_READY)
432  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
433  0 : _PyUnicode_Ready((PyObject *)(op)))
434  #else
435  #define __Pyx_PyUnicode_READY(op) (0)
436  #endif
437  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
438  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
439  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
440  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
441  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
442  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
443  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
444  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
445  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
446  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
447  #else
448  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
449  #endif
450  #else
451  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
452  #endif
453 #else
454  #define CYTHON_PEP393_ENABLED 0
455  #define PyUnicode_1BYTE_KIND 1
456  #define PyUnicode_2BYTE_KIND 2
457  #define PyUnicode_4BYTE_KIND 4
458  #define __Pyx_PyUnicode_READY(op) (0)
459  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
460  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
461  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
462  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
463  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
464  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
465  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
466  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY
469  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
470  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
471 #else
472  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
473  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
474  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
477  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
478 #endif
479 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
480  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
481 #endif
482 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
483  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
484 #endif
485 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
486 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
487 #if PY_MAJOR_VERSION >= 3
488  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
489 #else
490  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
491 #endif
492 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
493  #define PyObject_ASCII(o) PyObject_Repr(o)
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496  #define PyBaseString_Type PyUnicode_Type
497  #define PyStringObject PyUnicodeObject
498  #define PyString_Type PyUnicode_Type
499  #define PyString_Check PyUnicode_Check
500  #define PyString_CheckExact PyUnicode_CheckExact
501 #ifndef PyObject_Unicode
502  #define PyObject_Unicode PyObject_Str
503 #endif
504 #endif
505 #if PY_MAJOR_VERSION >= 3
506  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
507  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
508 #else
509  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
510  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
511 #endif
512 #ifndef PySet_CheckExact
513  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
514 #endif
515 #if PY_VERSION_HEX >= 0x030900A4
516  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
517  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
518 #else
519  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
520  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
521 #endif
522 #if CYTHON_ASSUME_SAFE_MACROS
523  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
524 #else
525  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
526 #endif
527 #if PY_MAJOR_VERSION >= 3
528  #define PyIntObject PyLongObject
529  #define PyInt_Type PyLong_Type
530  #define PyInt_Check(op) PyLong_Check(op)
531  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
532  #define PyInt_FromString PyLong_FromString
533  #define PyInt_FromUnicode PyLong_FromUnicode
534  #define PyInt_FromLong PyLong_FromLong
535  #define PyInt_FromSize_t PyLong_FromSize_t
536  #define PyInt_FromSsize_t PyLong_FromSsize_t
537  #define PyInt_AsLong PyLong_AsLong
538  #define PyInt_AS_LONG PyLong_AS_LONG
539  #define PyInt_AsSsize_t PyLong_AsSsize_t
540  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
541  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
542  #define PyNumber_Int PyNumber_Long
543 #endif
544 #if PY_MAJOR_VERSION >= 3
545  #define PyBoolObject PyLongObject
546 #endif
547 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
548  #ifndef PyUnicode_InternFromString
549  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
550  #endif
551 #endif
552 #if PY_VERSION_HEX < 0x030200A4
553  typedef long Py_hash_t;
554  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
555  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
556 #else
557  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
558  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
559 #endif
560 #if PY_MAJOR_VERSION >= 3
561  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
562 #else
563  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
564 #endif
565 #if CYTHON_USE_ASYNC_SLOTS
566  #if PY_VERSION_HEX >= 0x030500B1
567  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
568  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
569  #else
570  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
571  #endif
572 #else
573  #define __Pyx_PyType_AsAsync(obj) NULL
574 #endif
575 #ifndef __Pyx_PyAsyncMethodsStruct
576  typedef struct {
577  unaryfunc am_await;
578  unaryfunc am_aiter;
579  unaryfunc am_anext;
580  } __Pyx_PyAsyncMethodsStruct;
581 #endif
582 
583 #if defined(WIN32) || defined(MS_WINDOWS)
584  #define _USE_MATH_DEFINES
585 #endif
586 #include <math.h>
587 #ifdef NAN
588 #define __PYX_NAN() ((float) NAN)
589 #else
590 static CYTHON_INLINE float __PYX_NAN() {
591  float value;
592  memset(&value, 0xFF, sizeof(value));
593  return value;
594 }
595 #endif
596 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
597 #define __Pyx_truncl trunc
598 #else
599 #define __Pyx_truncl truncl
600 #endif
601 
602 #define __PYX_MARK_ERR_POS(f_index, lineno) \
603  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
604 #define __PYX_ERR(f_index, lineno, Ln_error) \
605  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
606 
607 #ifndef __PYX_EXTERN_C
608  #ifdef __cplusplus
609  #define __PYX_EXTERN_C extern "C"
610  #else
611  #define __PYX_EXTERN_C extern
612  #endif
613 #endif
614 
615 #define __PYX_HAVE__csmoothers
616 #define __PYX_HAVE_API__csmoothers
617 /* Early includes */
618 #include <string.h>
619 #include <stdio.h>
620 #include "numpy/arrayobject.h"
621 #include "numpy/ndarrayobject.h"
622 #include "numpy/ndarraytypes.h"
623 #include "numpy/arrayscalars.h"
624 #include "numpy/ufuncobject.h"
625 
626  /* NumPy API declarations from "numpy/__init__.pxd" */
627 
628 #include "proteus_superlu.h"
629 #include "smoothers.h"
630 #include "pythread.h"
631 #include <stdlib.h>
632 #include "pystate.h"
633 #ifdef _OPENMP
634 #include <omp.h>
635 #endif /* _OPENMP */
636 
637 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
638 #define CYTHON_WITHOUT_ASSERTIONS
639 #endif
640 
641 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
642  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
643 
644 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
645 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
646 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
647 #define __PYX_DEFAULT_STRING_ENCODING ""
648 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
649 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
650 #define __Pyx_uchar_cast(c) ((unsigned char)c)
651 #define __Pyx_long_cast(x) ((long)x)
652 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
653  (sizeof(type) < sizeof(Py_ssize_t)) ||\
654  (sizeof(type) > sizeof(Py_ssize_t) &&\
655  likely(v < (type)PY_SSIZE_T_MAX ||\
656  v == (type)PY_SSIZE_T_MAX) &&\
657  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
658  v == (type)PY_SSIZE_T_MIN))) ||\
659  (sizeof(type) == sizeof(Py_ssize_t) &&\
660  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
661  v == (type)PY_SSIZE_T_MAX))) )
662 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
663  return (size_t) i < (size_t) limit;
664 }
665 #if defined (__cplusplus) && __cplusplus >= 201103L
666  #include <cstdlib>
667  #define __Pyx_sst_abs(value) std::abs(value)
668 #elif SIZEOF_INT >= SIZEOF_SIZE_T
669  #define __Pyx_sst_abs(value) abs(value)
670 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
671  #define __Pyx_sst_abs(value) labs(value)
672 #elif defined (_MSC_VER)
673  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
674 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
675  #define __Pyx_sst_abs(value) llabs(value)
676 #elif defined (__GNUC__)
677  #define __Pyx_sst_abs(value) __builtin_llabs(value)
678 #else
679  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
680 #endif
681 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
682 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
683 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
684 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
685 #define __Pyx_PyBytes_FromString PyBytes_FromString
686 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
687 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
688 #if PY_MAJOR_VERSION < 3
689  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
690  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
691 #else
692  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
693  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
694 #endif
695 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
699 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
700 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
701 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
704 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
705 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
706 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
707 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
708 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
709 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
710 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
711 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
712  const Py_UNICODE *u_end = u;
713  while (*u_end++) ;
714  return (size_t)(u_end - u - 1);
715 }
716 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
717 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
718 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
719 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
720 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
721 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
722 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
723 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
724 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
725 #define __Pyx_PySequence_Tuple(obj)\
726  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
727 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
728 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
729 #if CYTHON_ASSUME_SAFE_MACROS
730 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
731 #else
732 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
733 #endif
734 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
735 #if PY_MAJOR_VERSION >= 3
736 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
737 #else
738 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
739 #endif
740 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
741 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
742 static int __Pyx_sys_getdefaultencoding_not_ascii;
743 static int __Pyx_init_sys_getdefaultencoding_params(void) {
744  PyObject* sys;
745  PyObject* default_encoding = NULL;
746  PyObject* ascii_chars_u = NULL;
747  PyObject* ascii_chars_b = NULL;
748  const char* default_encoding_c;
749  sys = PyImport_ImportModule("sys");
750  if (!sys) goto bad;
751  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
752  Py_DECREF(sys);
753  if (!default_encoding) goto bad;
754  default_encoding_c = PyBytes_AsString(default_encoding);
755  if (!default_encoding_c) goto bad;
756  if (strcmp(default_encoding_c, "ascii") == 0) {
757  __Pyx_sys_getdefaultencoding_not_ascii = 0;
758  } else {
759  char ascii_chars[128];
760  int c;
761  for (c = 0; c < 128; c++) {
762  ascii_chars[c] = c;
763  }
764  __Pyx_sys_getdefaultencoding_not_ascii = 1;
765  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
766  if (!ascii_chars_u) goto bad;
767  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
768  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
769  PyErr_Format(
770  PyExc_ValueError,
771  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
772  default_encoding_c);
773  goto bad;
774  }
775  Py_DECREF(ascii_chars_u);
776  Py_DECREF(ascii_chars_b);
777  }
778  Py_DECREF(default_encoding);
779  return 0;
780 bad:
781  Py_XDECREF(default_encoding);
782  Py_XDECREF(ascii_chars_u);
783  Py_XDECREF(ascii_chars_b);
784  return -1;
785 }
786 #endif
787 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
788 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
789 #else
790 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
791 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
792 static char* __PYX_DEFAULT_STRING_ENCODING;
793 static int __Pyx_init_sys_getdefaultencoding_params(void) {
794  PyObject* sys;
795  PyObject* default_encoding = NULL;
796  char* default_encoding_c;
797  sys = PyImport_ImportModule("sys");
798  if (!sys) goto bad;
799  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
800  Py_DECREF(sys);
801  if (!default_encoding) goto bad;
802  default_encoding_c = PyBytes_AsString(default_encoding);
803  if (!default_encoding_c) goto bad;
804  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
805  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
806  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
807  Py_DECREF(default_encoding);
808  return 0;
809 bad:
810  Py_XDECREF(default_encoding);
811  return -1;
812 }
813 #endif
814 #endif
815 
816 
817 /* Test for GCC > 2.95 */
818 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
819  #define likely(x) __builtin_expect(!!(x), 1)
820  #define unlikely(x) __builtin_expect(!!(x), 0)
821 #else /* !__GNUC__ or GCC < 2.95 */
822  #define likely(x) (x)
823  #define unlikely(x) (x)
824 #endif /* __GNUC__ */
825 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
826 
827 static PyObject *__pyx_m = NULL;
828 static PyObject *__pyx_d;
829 static PyObject *__pyx_b;
830 static PyObject *__pyx_cython_runtime = NULL;
831 static PyObject *__pyx_empty_tuple;
832 static PyObject *__pyx_empty_bytes;
833 static PyObject *__pyx_empty_unicode;
834 static int __pyx_lineno;
835 static int __pyx_clineno = 0;
836 static const char * __pyx_cfilenm= __FILE__;
837 static const char *__pyx_filename;
838 
839 /* Header.proto */
840 #if !defined(CYTHON_CCOMPLEX)
841  #if defined(__cplusplus)
842  #define CYTHON_CCOMPLEX 1
843  #elif defined(_Complex_I)
844  #define CYTHON_CCOMPLEX 1
845  #else
846  #define CYTHON_CCOMPLEX 0
847  #endif
848 #endif
849 #if CYTHON_CCOMPLEX
850  #ifdef __cplusplus
851  #include <complex>
852  #else
853  #include <complex.h>
854  #endif
855 #endif
856 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
857  #undef _Complex_I
858  #define _Complex_I 1.0fj
859 #endif
860 
861 
862 static const char *__pyx_f[] = {
863  "proteus/csmoothers.pyx",
864  "stringsource",
865  "__init__.pxd",
866  "type.pxd",
867  "proteus/superluWrappers.pxd",
868 };
869 /* MemviewSliceStruct.proto */
870 struct __pyx_memoryview_obj;
871 typedef struct {
872  struct __pyx_memoryview_obj *memview;
873  char *data;
874  Py_ssize_t shape[8];
875  Py_ssize_t strides[8];
876  Py_ssize_t suboffsets[8];
877 } __Pyx_memviewslice;
878 #define __Pyx_MemoryView_Len(m) (m.shape[0])
879 
880 /* Atomics.proto */
881 #include <pythread.h>
882 #ifndef CYTHON_ATOMICS
883  #define CYTHON_ATOMICS 1
884 #endif
885 #define __pyx_atomic_int_type int
886 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
887  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
888  !defined(__i386__)
889  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
890  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
891  #ifdef __PYX_DEBUG_ATOMICS
892  #warning "Using GNU atomics"
893  #endif
894 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
895  #include <Windows.h>
896  #undef __pyx_atomic_int_type
897  #define __pyx_atomic_int_type LONG
898  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
899  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
900  #ifdef __PYX_DEBUG_ATOMICS
901  #pragma message ("Using MSVC atomics")
902  #endif
903 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
904  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
905  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
906  #ifdef __PYX_DEBUG_ATOMICS
907  #warning "Using Intel atomics"
908  #endif
909 #else
910  #undef CYTHON_ATOMICS
911  #define CYTHON_ATOMICS 0
912  #ifdef __PYX_DEBUG_ATOMICS
913  #warning "Not using atomics"
914  #endif
915 #endif
916 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
917 #if CYTHON_ATOMICS
918  #define __pyx_add_acquisition_count(memview)\
919  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
920  #define __pyx_sub_acquisition_count(memview)\
921  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
922 #else
923  #define __pyx_add_acquisition_count(memview)\
924  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
925  #define __pyx_sub_acquisition_count(memview)\
926  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
927 #endif
928 
929 /* ForceInitThreads.proto */
930 #ifndef __PYX_FORCE_INIT_THREADS
931  #define __PYX_FORCE_INIT_THREADS 0
932 #endif
933 
934 /* NoFastGil.proto */
935 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
936 #define __Pyx_PyGILState_Release PyGILState_Release
937 #define __Pyx_FastGIL_Remember()
938 #define __Pyx_FastGIL_Forget()
939 #define __Pyx_FastGilFuncInit()
940 
941 /* BufferFormatStructs.proto */
942 #define IS_UNSIGNED(type) (((type) -1) > 0)
943 struct __Pyx_StructField_;
944 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
945 typedef struct {
946  const char* name;
947  struct __Pyx_StructField_* fields;
948  size_t size;
949  size_t arraysize[8];
950  int ndim;
951  char typegroup;
952  char is_unsigned;
953  int flags;
954 } __Pyx_TypeInfo;
955 typedef struct __Pyx_StructField_ {
956  __Pyx_TypeInfo* type;
957  const char* name;
958  size_t offset;
959 } __Pyx_StructField;
960 typedef struct {
961  __Pyx_StructField* field;
962  size_t parent_offset;
963 } __Pyx_BufFmt_StackElem;
964 typedef struct {
965  __Pyx_StructField root;
966  __Pyx_BufFmt_StackElem* head;
967  size_t fmt_offset;
968  size_t new_count, enc_count;
969  size_t struct_alignment;
970  int is_complex;
971  char enc_type;
972  char new_packmode;
973  char enc_packmode;
974  char is_valid_array;
975 } __Pyx_BufFmt_Context;
976 
977 
978 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":690
979  * # in Cython to enable them only on the right systems.
980  *
981  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
982  * ctypedef npy_int16 int16_t
983  * ctypedef npy_int32 int32_t
984  */
985 typedef npy_int8 __pyx_t_5numpy_int8_t;
986 
987 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":691
988  *
989  * ctypedef npy_int8 int8_t
990  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
991  * ctypedef npy_int32 int32_t
992  * ctypedef npy_int64 int64_t
993  */
994 typedef npy_int16 __pyx_t_5numpy_int16_t;
995 
996 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":692
997  * ctypedef npy_int8 int8_t
998  * ctypedef npy_int16 int16_t
999  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1000  * ctypedef npy_int64 int64_t
1001  * #ctypedef npy_int96 int96_t
1002  */
1003 typedef npy_int32 __pyx_t_5numpy_int32_t;
1004 
1005 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":693
1006  * ctypedef npy_int16 int16_t
1007  * ctypedef npy_int32 int32_t
1008  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1009  * #ctypedef npy_int96 int96_t
1010  * #ctypedef npy_int128 int128_t
1011  */
1012 typedef npy_int64 __pyx_t_5numpy_int64_t;
1013 
1014 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":697
1015  * #ctypedef npy_int128 int128_t
1016  *
1017  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1018  * ctypedef npy_uint16 uint16_t
1019  * ctypedef npy_uint32 uint32_t
1020  */
1021 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1022 
1023 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":698
1024  *
1025  * ctypedef npy_uint8 uint8_t
1026  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1027  * ctypedef npy_uint32 uint32_t
1028  * ctypedef npy_uint64 uint64_t
1029  */
1030 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1031 
1032 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":699
1033  * ctypedef npy_uint8 uint8_t
1034  * ctypedef npy_uint16 uint16_t
1035  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1036  * ctypedef npy_uint64 uint64_t
1037  * #ctypedef npy_uint96 uint96_t
1038  */
1039 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1040 
1041 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":700
1042  * ctypedef npy_uint16 uint16_t
1043  * ctypedef npy_uint32 uint32_t
1044  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1045  * #ctypedef npy_uint96 uint96_t
1046  * #ctypedef npy_uint128 uint128_t
1047  */
1048 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1049 
1050 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":704
1051  * #ctypedef npy_uint128 uint128_t
1052  *
1053  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1054  * ctypedef npy_float64 float64_t
1055  * #ctypedef npy_float80 float80_t
1056  */
1057 typedef npy_float32 __pyx_t_5numpy_float32_t;
1058 
1059 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":705
1060  *
1061  * ctypedef npy_float32 float32_t
1062  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1063  * #ctypedef npy_float80 float80_t
1064  * #ctypedef npy_float128 float128_t
1065  */
1066 typedef npy_float64 __pyx_t_5numpy_float64_t;
1067 
1068 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":714
1069  * # The int types are mapped a bit surprising --
1070  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1071  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1072  * ctypedef npy_longlong long_t
1073  * ctypedef npy_longlong longlong_t
1074  */
1075 typedef npy_long __pyx_t_5numpy_int_t;
1076 
1077 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":715
1078  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1079  * ctypedef npy_long int_t
1080  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1081  * ctypedef npy_longlong longlong_t
1082  *
1083  */
1084 typedef npy_longlong __pyx_t_5numpy_long_t;
1085 
1086 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":716
1087  * ctypedef npy_long int_t
1088  * ctypedef npy_longlong long_t
1089  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1090  *
1091  * ctypedef npy_ulong uint_t
1092  */
1093 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1094 
1095 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":718
1096  * ctypedef npy_longlong longlong_t
1097  *
1098  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1099  * ctypedef npy_ulonglong ulong_t
1100  * ctypedef npy_ulonglong ulonglong_t
1101  */
1102 typedef npy_ulong __pyx_t_5numpy_uint_t;
1103 
1104 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":719
1105  *
1106  * ctypedef npy_ulong uint_t
1107  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1108  * ctypedef npy_ulonglong ulonglong_t
1109  *
1110  */
1111 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1112 
1113 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":720
1114  * ctypedef npy_ulong uint_t
1115  * ctypedef npy_ulonglong ulong_t
1116  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1117  *
1118  * ctypedef npy_intp intp_t
1119  */
1120 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1121 
1122 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":722
1123  * ctypedef npy_ulonglong ulonglong_t
1124  *
1125  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1126  * ctypedef npy_uintp uintp_t
1127  *
1128  */
1129 typedef npy_intp __pyx_t_5numpy_intp_t;
1130 
1131 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":723
1132  *
1133  * ctypedef npy_intp intp_t
1134  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1135  *
1136  * ctypedef npy_double float_t
1137  */
1138 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1139 
1140 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":725
1141  * ctypedef npy_uintp uintp_t
1142  *
1143  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1144  * ctypedef npy_double double_t
1145  * ctypedef npy_longdouble longdouble_t
1146  */
1147 typedef npy_double __pyx_t_5numpy_float_t;
1148 
1149 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":726
1150  *
1151  * ctypedef npy_double float_t
1152  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1153  * ctypedef npy_longdouble longdouble_t
1154  *
1155  */
1156 typedef npy_double __pyx_t_5numpy_double_t;
1157 
1158 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":727
1159  * ctypedef npy_double float_t
1160  * ctypedef npy_double double_t
1161  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1162  *
1163  * ctypedef npy_cfloat cfloat_t
1164  */
1165 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1166 
1167 /* "csmoothers.pxd":3
1168  * from proteus cimport superluWrappers
1169  *
1170  * ctypedef int PROTEUS_LAPACK_INTEGER # <<<<<<<<<<<<<<
1171  * # ARB - the compiler macro does not seem to be picking this up...
1172  * ctypedef double [:] DDATA
1173  */
1174 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1175 /* Declarations.proto */
1176 #if CYTHON_CCOMPLEX
1177  #ifdef __cplusplus
1178  typedef ::std::complex< float > __pyx_t_float_complex;
1179  #else
1180  typedef float _Complex __pyx_t_float_complex;
1181  #endif
1182 #else
1183  typedef struct { float real, imag; } __pyx_t_float_complex;
1184 #endif
1185 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1186 
1187 /* Declarations.proto */
1188 #if CYTHON_CCOMPLEX
1189  #ifdef __cplusplus
1190  typedef ::std::complex< double > __pyx_t_double_complex;
1191  #else
1192  typedef double _Complex __pyx_t_double_complex;
1193  #endif
1194 #else
1195  typedef struct { double real, imag; } __pyx_t_double_complex;
1196 #endif
1197 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1198 
1199 
1200 /*--- Type declarations ---*/
1201 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1202 struct __pyx_obj_10csmoothers_cASMFactor;
1203 struct __pyx_obj_10csmoothers_cBASMFactor;
1204 struct __pyx_array_obj;
1205 struct __pyx_MemviewEnum_obj;
1206 struct __pyx_memoryview_obj;
1207 struct __pyx_memoryviewslice_obj;
1208 
1209 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":729
1210  * ctypedef npy_longdouble longdouble_t
1211  *
1212  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1213  * ctypedef npy_cdouble cdouble_t
1214  * ctypedef npy_clongdouble clongdouble_t
1215  */
1216 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1217 
1218 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":730
1219  *
1220  * ctypedef npy_cfloat cfloat_t
1221  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1222  * ctypedef npy_clongdouble clongdouble_t
1223  *
1224  */
1225 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1226 
1227 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":731
1228  * ctypedef npy_cfloat cfloat_t
1229  * ctypedef npy_cdouble cdouble_t
1230  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1231  *
1232  * ctypedef npy_cdouble complex_t
1233  */
1234 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1235 
1236 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":733
1237  * ctypedef npy_clongdouble clongdouble_t
1238  *
1239  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1240  *
1241  * cdef inline object PyArray_MultiIterNew1(a):
1242  */
1243 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1244 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1245 
1246 /* "superluWrappers.pxd":61
1247  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1248  *
1249  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1250  * np.int32_t nnz
1251  * np.float64_t * nzval
1252  */
1253 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1254  __pyx_t_5numpy_int32_t nnz;
1255  __pyx_t_5numpy_float64_t *nzval;
1256  __pyx_t_5numpy_int32_t *colind;
1257  __pyx_t_5numpy_int32_t *rowptr;
1258 };
1259 
1260 /* "csmoothers.pxd":5
1261  * ctypedef int PROTEUS_LAPACK_INTEGER
1262  * # ARB - the compiler macro does not seem to be picking this up...
1263  * ctypedef double [:] DDATA # <<<<<<<<<<<<<<
1264  * ctypedef int [:] IDATA
1265  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1266  */
1267 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1268 
1269 /* "csmoothers.pxd":6
1270  * # ARB - the compiler macro does not seem to be picking this up...
1271  * ctypedef double [:] DDATA
1272  * ctypedef int [:] IDATA # <<<<<<<<<<<<<<
1273  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1274  *
1275  */
1276 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1277 
1278 /* "csmoothers.pxd":7
1279  * ctypedef double [:] DDATA
1280  * ctypedef int [:] IDATA
1281  * ctypedef superluWrappers._SuperMatrix SuperMatrix # <<<<<<<<<<<<<<
1282  *
1283  * cdef extern from "smoothers.h":
1284  */
1285 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1286 
1287 /* "superluWrappers.pxd":67
1288  * np.int32_t * rowptr
1289  *
1290  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1291  * cdef np.int32_t dim[2]
1292  * cdef _NRformat A
1293  */
1294 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1295  PyObject_HEAD
1296  __pyx_t_5numpy_int32_t dim[2];
1297  struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1298 };
1299 
1300 
1301 /* "csmoothers.pxd":25
1302  * void cbasm_NR_solve "basm_NR_solve"(int rowBlocks, int N, superluWrappers._SuperMatrix *A, double w, double** subdomainL, int* subdomain_dim, int** l2g_L, double* R, double** subdomainR, int* node_order, double** subdomain_dX, double* dX, PROTEUS_LAPACK_INTEGER** subdomainPivots, PROTEUS_LAPACK_INTEGER** subdomainColPivots)
1303  *
1304  * cdef class cASMFactor(object): # <<<<<<<<<<<<<<
1305  * cdef int N
1306  * cdef int *subdomain_dim
1307  */
1308 struct __pyx_obj_10csmoothers_cASMFactor {
1309  PyObject_HEAD
1310  int N;
1311  int *subdomain_dim;
1312  int **l2g_L;
1313  double **subdomain_L;
1314  double **subdomain_R;
1315  double **subdomain_dX;
1316  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1317 };
1318 
1319 
1320 /* "csmoothers.pxd":34
1321  * cdef PROTEUS_LAPACK_INTEGER **subdomain_pivots
1322  *
1323  * cdef class cBASMFactor(object): # <<<<<<<<<<<<<<
1324  * cdef int N
1325  * cdef int bs
1326  */
1327 struct __pyx_obj_10csmoothers_cBASMFactor {
1328  PyObject_HEAD
1329  int N;
1330  int bs;
1331  int *subdomain_dim;
1332  int **l2g_L;
1333  double **subdomain_L;
1334  double **subdomain_R;
1335  double **subdomain_dX;
1336  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1337  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1338 };
1339 
1340 
1341 /* "View.MemoryView":105
1342  *
1343  * @cname("__pyx_array")
1344  * cdef class array: # <<<<<<<<<<<<<<
1345  *
1346  * cdef:
1347  */
1348 struct __pyx_array_obj {
1349  PyObject_HEAD
1350  struct __pyx_vtabstruct_array *__pyx_vtab;
1351  char *data;
1352  Py_ssize_t len;
1353  char *format;
1354  int ndim;
1355  Py_ssize_t *_shape;
1356  Py_ssize_t *_strides;
1357  Py_ssize_t itemsize;
1358  PyObject *mode;
1359  PyObject *_format;
1360  void (*callback_free_data)(void *);
1361  int free_data;
1362  int dtype_is_object;
1363 };
1364 
1365 
1366 /* "View.MemoryView":279
1367  *
1368  * @cname('__pyx_MemviewEnum')
1369  * cdef class Enum(object): # <<<<<<<<<<<<<<
1370  * cdef object name
1371  * def __init__(self, name):
1372  */
1373 struct __pyx_MemviewEnum_obj {
1374  PyObject_HEAD
1375  PyObject *name;
1376 };
1377 
1378 
1379 /* "View.MemoryView":330
1380  *
1381  * @cname('__pyx_memoryview')
1382  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1383  *
1384  * cdef object obj
1385  */
1386 struct __pyx_memoryview_obj {
1387  PyObject_HEAD
1388  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1389  PyObject *obj;
1390  PyObject *_size;
1391  PyObject *_array_interface;
1392  PyThread_type_lock lock;
1393  __pyx_atomic_int acquisition_count[2];
1394  __pyx_atomic_int *acquisition_count_aligned_p;
1395  Py_buffer view;
1396  int flags;
1397  int dtype_is_object;
1398  __Pyx_TypeInfo *typeinfo;
1399 };
1400 
1401 
1402 /* "View.MemoryView":965
1403  *
1404  * @cname('__pyx_memoryviewslice')
1405  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1406  * "Internal class for passing memoryview slices to Python"
1407  *
1408  */
1409 struct __pyx_memoryviewslice_obj {
1410  struct __pyx_memoryview_obj __pyx_base;
1411  __Pyx_memviewslice from_slice;
1412  PyObject *from_object;
1413  PyObject *(*to_object_func)(char *);
1414  int (*to_dtype_func)(char *, PyObject *);
1415 };
1416 
1417 
1418 
1419 /* "View.MemoryView":105
1420  *
1421  * @cname("__pyx_array")
1422  * cdef class array: # <<<<<<<<<<<<<<
1423  *
1424  * cdef:
1425  */
1426 
1427 struct __pyx_vtabstruct_array {
1428  PyObject *(*get_memview)(struct __pyx_array_obj *);
1429 };
1430 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1431 
1432 
1433 /* "View.MemoryView":330
1434  *
1435  * @cname('__pyx_memoryview')
1436  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1437  *
1438  * cdef object obj
1439  */
1440 
1441 struct __pyx_vtabstruct_memoryview {
1442  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1443  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1444  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1445  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1446  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1447  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1448  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1449 };
1450 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1451 
1452 
1453 /* "View.MemoryView":965
1454  *
1455  * @cname('__pyx_memoryviewslice')
1456  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1457  * "Internal class for passing memoryview slices to Python"
1458  *
1459  */
1460 
1461 struct __pyx_vtabstruct__memoryviewslice {
1462  struct __pyx_vtabstruct_memoryview __pyx_base;
1463 };
1464 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1465 
1466 /* --- Runtime support code (head) --- */
1467 /* Refnanny.proto */
1468 #ifndef CYTHON_REFNANNY
1469  #define CYTHON_REFNANNY 0
1470 #endif
1471 #if CYTHON_REFNANNY
1472  typedef struct {
1473  void (*INCREF)(void*, PyObject*, int);
1474  void (*DECREF)(void*, PyObject*, int);
1475  void (*GOTREF)(void*, PyObject*, int);
1476  void (*GIVEREF)(void*, PyObject*, int);
1477  void* (*SetupContext)(const char*, int, const char*);
1478  void (*FinishContext)(void**);
1479  } __Pyx_RefNannyAPIStruct;
1480  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1481  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1482  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1483 #ifdef WITH_THREAD
1484  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1485  if (acquire_gil) {\
1486  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1487  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1488  PyGILState_Release(__pyx_gilstate_save);\
1489  } else {\
1490  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1491  }
1492 #else
1493  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1494  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1495 #endif
1496  #define __Pyx_RefNannyFinishContext()\
1497  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1498  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1499  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1500  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1501  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1502  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1503  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1504  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1505  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1506 #else
1507  #define __Pyx_RefNannyDeclarations
1508  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1509  #define __Pyx_RefNannyFinishContext()
1510  #define __Pyx_INCREF(r) Py_INCREF(r)
1511  #define __Pyx_DECREF(r) Py_DECREF(r)
1512  #define __Pyx_GOTREF(r)
1513  #define __Pyx_GIVEREF(r)
1514  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1515  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1516  #define __Pyx_XGOTREF(r)
1517  #define __Pyx_XGIVEREF(r)
1518 #endif
1519 #define __Pyx_XDECREF_SET(r, v) do {\
1520  PyObject *tmp = (PyObject *) r;\
1521  r = v; __Pyx_XDECREF(tmp);\
1522  } while (0)
1523 #define __Pyx_DECREF_SET(r, v) do {\
1524  PyObject *tmp = (PyObject *) r;\
1525  r = v; __Pyx_DECREF(tmp);\
1526  } while (0)
1527 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1528 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1529 
1530 /* PyObjectGetAttrStr.proto */
1531 #if CYTHON_USE_TYPE_SLOTS
1532 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1533 #else
1534 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1535 #endif
1536 
1537 /* GetBuiltinName.proto */
1538 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1539 
1540 /* RaiseArgTupleInvalid.proto */
1541 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1542  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1543 
1544 /* RaiseDoubleKeywords.proto */
1545 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1546 
1547 /* ParseKeywords.proto */
1548 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1549  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1550  const char* function_name);
1551 
1552 /* PyObjectSetAttrStr.proto */
1553 #if CYTHON_USE_TYPE_SLOTS
1554 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1555 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1556 #else
1557 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1558 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1559 #endif
1560 
1561 /* PyCFunctionFastCall.proto */
1562 #if CYTHON_FAST_PYCCALL
1563 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1564 #else
1565 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1566 #endif
1567 
1568 /* PyFunctionFastCall.proto */
1569 #if CYTHON_FAST_PYCALL
1570 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1571  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1572 #if 1 || PY_VERSION_HEX < 0x030600B1
1573 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1574 #else
1575 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1576 #endif
1577 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1578  (sizeof(char [1 - 2*!(cond)]) - 1)
1579 #ifndef Py_MEMBER_SIZE
1580 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1581 #endif
1582  static size_t __pyx_pyframe_localsplus_offset = 0;
1583  #include "frameobject.h"
1584  #define __Pxy_PyFrame_Initialize_Offsets()\
1585  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1586  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1587  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1588  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1589 #endif
1590 
1591 /* PyObjectCall.proto */
1592 #if CYTHON_COMPILING_IN_CPYTHON
1593 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1594 #else
1595 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1596 #endif
1597 
1598 /* PyObjectCallMethO.proto */
1599 #if CYTHON_COMPILING_IN_CPYTHON
1600 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1601 #endif
1602 
1603 /* PyObjectCallOneArg.proto */
1604 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1605 
1606 /* ArgTypeTest.proto */
1607 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1608  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1609  __Pyx__ArgTypeTest(obj, type, name, exact))
1610 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1611 
1612 /* PyThreadStateGet.proto */
1613 #if CYTHON_FAST_THREAD_STATE
1614 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1615 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1616 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1617 #else
1618 #define __Pyx_PyThreadState_declare
1619 #define __Pyx_PyThreadState_assign
1620 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1621 #endif
1622 
1623 /* PyErrFetchRestore.proto */
1624 #if CYTHON_FAST_THREAD_STATE
1625 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1626 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1627 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1628 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1629 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1630 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1631 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1632 #if CYTHON_COMPILING_IN_CPYTHON
1633 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1634 #else
1635 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1636 #endif
1637 #else
1638 #define __Pyx_PyErr_Clear() PyErr_Clear()
1639 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1640 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1641 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1642 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1643 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1644 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1645 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1646 #endif
1647 
1648 /* RaiseException.proto */
1649 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1650 
1651 /* ExtTypeTest.proto */
1652 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1653 
1654 /* MemviewSliceInit.proto */
1655 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1656 #define __Pyx_MEMVIEW_DIRECT 1
1657 #define __Pyx_MEMVIEW_PTR 2
1658 #define __Pyx_MEMVIEW_FULL 4
1659 #define __Pyx_MEMVIEW_CONTIG 8
1660 #define __Pyx_MEMVIEW_STRIDED 16
1661 #define __Pyx_MEMVIEW_FOLLOW 32
1662 #define __Pyx_IS_C_CONTIG 1
1663 #define __Pyx_IS_F_CONTIG 2
1664 static int __Pyx_init_memviewslice(
1665  struct __pyx_memoryview_obj *memview,
1666  int ndim,
1667  __Pyx_memviewslice *memviewslice,
1668  int memview_is_new_reference);
1669 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1670  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1671 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1672  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1673 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1674 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1675 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1676 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1677 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1678 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1679 
1680 /* BufferIndexError.proto */
1681 static void __Pyx_RaiseBufferIndexError(int axis);
1682 
1683 /* WriteUnraisableException.proto */
1684 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1685  int lineno, const char *filename,
1686  int full_traceback, int nogil);
1687 
1688 /* GetTopmostException.proto */
1689 #if CYTHON_USE_EXC_INFO_STACK
1690 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1691 #endif
1692 
1693 /* SaveResetException.proto */
1694 #if CYTHON_FAST_THREAD_STATE
1695 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1696 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1697 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1698 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1699 #else
1700 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1701 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1702 #endif
1703 
1704 /* PyErrExceptionMatches.proto */
1705 #if CYTHON_FAST_THREAD_STATE
1706 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1707 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1708 #else
1709 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1710 #endif
1711 
1712 /* GetException.proto */
1713 #if CYTHON_FAST_THREAD_STATE
1714 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1715 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1716 #else
1717 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1718 #endif
1719 
1720 /* PyObjectCall2Args.proto */
1721 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1722 
1723 /* IncludeStringH.proto */
1724 #include <string.h>
1725 
1726 /* BytesEquals.proto */
1727 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1728 
1729 /* UnicodeEquals.proto */
1730 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1731 
1732 /* StrEquals.proto */
1733 #if PY_MAJOR_VERSION >= 3
1734 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1735 #else
1736 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1737 #endif
1738 
1739 /* None.proto */
1740 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1741 
1742 /* UnaryNegOverflows.proto */
1743 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1744  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1745 
1746 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1747 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1748 /* GetAttr.proto */
1749 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1750 
1751 /* GetItemInt.proto */
1752 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1753  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1754  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1755  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1756  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1757 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1758  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1759  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1760  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1761 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1762  int wraparound, int boundscheck);
1763 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1764  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1765  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1766  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1767 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1768  int wraparound, int boundscheck);
1769 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1770 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1771  int is_list, int wraparound, int boundscheck);
1772 
1773 /* ObjectGetItem.proto */
1774 #if CYTHON_USE_TYPE_SLOTS
1775 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1776 #else
1777 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1778 #endif
1779 
1780 /* decode_c_string_utf16.proto */
1781 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1782  int byteorder = 0;
1783  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1784 }
1785 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1786  int byteorder = -1;
1787  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1788 }
1789 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1790  int byteorder = 1;
1791  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1792 }
1793 
1794 /* decode_c_string.proto */
1795 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1796  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1797  const char* encoding, const char* errors,
1798  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1799 
1800 /* GetAttr3.proto */
1801 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1802 
1803 /* PyDictVersioning.proto */
1804 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1805 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1806 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1807 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1808  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1809  (cache_var) = (value);
1810 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1811  static PY_UINT64_T __pyx_dict_version = 0;\
1812  static PyObject *__pyx_dict_cached_value = NULL;\
1813  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1814  (VAR) = __pyx_dict_cached_value;\
1815  } else {\
1816  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1817  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1818  }\
1819 }
1820 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1821 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1822 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1823 #else
1824 #define __PYX_GET_DICT_VERSION(dict) (0)
1825 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1826 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1827 #endif
1828 
1829 /* GetModuleGlobalName.proto */
1830 #if CYTHON_USE_DICT_VERSIONS
1831 #define __Pyx_GetModuleGlobalName(var, name) {\
1832  static PY_UINT64_T __pyx_dict_version = 0;\
1833  static PyObject *__pyx_dict_cached_value = NULL;\
1834  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1835  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1836  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1837 }
1838 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1839  PY_UINT64_T __pyx_dict_version;\
1840  PyObject *__pyx_dict_cached_value;\
1841  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1842 }
1843 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1844 #else
1845 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1846 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1847 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1848 #endif
1849 
1850 /* RaiseTooManyValuesToUnpack.proto */
1851 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1852 
1853 /* RaiseNeedMoreValuesToUnpack.proto */
1854 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1855 
1856 /* RaiseNoneIterError.proto */
1857 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1858 
1859 /* SwapException.proto */
1860 #if CYTHON_FAST_THREAD_STATE
1861 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1862 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1863 #else
1864 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1865 #endif
1866 
1867 /* Import.proto */
1868 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1869 
1870 /* FastTypeChecks.proto */
1871 #if CYTHON_COMPILING_IN_CPYTHON
1872 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1873 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1874 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1875 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1876 #else
1877 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1878 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1879 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1880 #endif
1881 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1882 
1883 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1884 /* ListCompAppend.proto */
1885 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1886 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1887  PyListObject* L = (PyListObject*) list;
1888  Py_ssize_t len = Py_SIZE(list);
1889  if (likely(L->allocated > len)) {
1890  Py_INCREF(x);
1891  PyList_SET_ITEM(list, len, x);
1892  __Pyx_SET_SIZE(list, len + 1);
1893  return 0;
1894  }
1895  return PyList_Append(list, x);
1896 }
1897 #else
1898 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1899 #endif
1900 
1901 /* PyIntBinop.proto */
1902 #if !CYTHON_COMPILING_IN_PYPY
1903 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1904 #else
1905 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1906  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1907 #endif
1908 
1909 /* ListExtend.proto */
1910 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1911 #if CYTHON_COMPILING_IN_CPYTHON
1912  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1913  if (unlikely(!none))
1914  return -1;
1915  Py_DECREF(none);
1916  return 0;
1917 #else
1918  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1919 #endif
1920 }
1921 
1922 /* ListAppend.proto */
1923 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1924 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1925  PyListObject* L = (PyListObject*) list;
1926  Py_ssize_t len = Py_SIZE(list);
1927  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1928  Py_INCREF(x);
1929  PyList_SET_ITEM(list, len, x);
1930  __Pyx_SET_SIZE(list, len + 1);
1931  return 0;
1932  }
1933  return PyList_Append(list, x);
1934 }
1935 #else
1936 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1937 #endif
1938 
1939 /* None.proto */
1940 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1941 
1942 /* None.proto */
1943 static CYTHON_INLINE long __Pyx_div_long(long, long);
1944 
1945 /* ImportFrom.proto */
1946 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1947 
1948 /* HasAttr.proto */
1949 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1950 
1951 /* PyObject_GenericGetAttrNoDict.proto */
1952 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1953 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1954 #else
1955 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1956 #endif
1957 
1958 /* PyObject_GenericGetAttr.proto */
1959 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1960 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1961 #else
1962 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1963 #endif
1964 
1965 /* PyObjectGetAttrStrNoError.proto */
1966 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1967 
1968 /* SetupReduce.proto */
1969 static int __Pyx_setup_reduce(PyObject* type_obj);
1970 
1971 /* SetVTable.proto */
1972 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1973 
1974 /* TypeImport.proto */
1975 #ifndef __PYX_HAVE_RT_ImportType_proto
1976 #define __PYX_HAVE_RT_ImportType_proto
1977 enum __Pyx_ImportType_CheckSize {
1978  __Pyx_ImportType_CheckSize_Error = 0,
1979  __Pyx_ImportType_CheckSize_Warn = 1,
1980  __Pyx_ImportType_CheckSize_Ignore = 2
1981 };
1982 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1983 #endif
1984 
1985 /* CalculateMetaclass.proto */
1986 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1987 
1988 /* FetchCommonType.proto */
1989 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1990 
1991 /* CythonFunctionShared.proto */
1992 #define __Pyx_CyFunction_USED 1
1993 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1994 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1995 #define __Pyx_CYFUNCTION_CCLASS 0x04
1996 #define __Pyx_CyFunction_GetClosure(f)\
1997  (((__pyx_CyFunctionObject *) (f))->func_closure)
1998 #define __Pyx_CyFunction_GetClassObj(f)\
1999  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2000 #define __Pyx_CyFunction_Defaults(type, f)\
2001  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2002 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2003  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2004 typedef struct {
2005  PyCFunctionObject func;
2006 #if PY_VERSION_HEX < 0x030500A0
2007  PyObject *func_weakreflist;
2008 #endif
2009  PyObject *func_dict;
2010  PyObject *func_name;
2011  PyObject *func_qualname;
2012  PyObject *func_doc;
2013  PyObject *func_globals;
2014  PyObject *func_code;
2015  PyObject *func_closure;
2016  PyObject *func_classobj;
2017  void *defaults;
2018  int defaults_pyobjects;
2019  size_t defaults_size; // used by FusedFunction for copying defaults
2020  int flags;
2021  PyObject *defaults_tuple;
2022  PyObject *defaults_kwdict;
2023  PyObject *(*defaults_getter)(PyObject *);
2024  PyObject *func_annotations;
2025 } __pyx_CyFunctionObject;
2026 static PyTypeObject *__pyx_CyFunctionType = 0;
2027 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2028 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2029  int flags, PyObject* qualname,
2030  PyObject *self,
2031  PyObject *module, PyObject *globals,
2032  PyObject* code);
2033 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2034  size_t size,
2035  int pyobjects);
2036 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2037  PyObject *tuple);
2038 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2039  PyObject *dict);
2040 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2041  PyObject *dict);
2042 static int __pyx_CyFunction_init(void);
2043 
2044 /* CythonFunction.proto */
2045 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2046  int flags, PyObject* qualname,
2047  PyObject *closure,
2048  PyObject *module, PyObject *globals,
2049  PyObject* code);
2050 
2051 /* SetNameInClass.proto */
2052 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2053 #define __Pyx_SetNameInClass(ns, name, value)\
2054  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2055 #elif CYTHON_COMPILING_IN_CPYTHON
2056 #define __Pyx_SetNameInClass(ns, name, value)\
2057  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2058 #else
2059 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2060 #endif
2061 
2062 /* Py3ClassCreate.proto */
2063 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2064  PyObject *mkw, PyObject *modname, PyObject *doc);
2065 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2066  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2067 
2068 /* CLineInTraceback.proto */
2069 #ifdef CYTHON_CLINE_IN_TRACEBACK
2070 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2071 #else
2072 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2073 #endif
2074 
2075 /* CodeObjectCache.proto */
2076 typedef struct {
2077  PyCodeObject* code_object;
2078  int code_line;
2079 } __Pyx_CodeObjectCacheEntry;
2080 struct __Pyx_CodeObjectCache {
2081  int count;
2082  int max_count;
2083  __Pyx_CodeObjectCacheEntry* entries;
2084 };
2085 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2086 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2087 static PyCodeObject *__pyx_find_code_object(int code_line);
2088 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2089 
2090 /* AddTraceback.proto */
2091 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2092  int py_line, const char *filename);
2093 
2094 #if PY_MAJOR_VERSION < 3
2095  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2096  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2097 #else
2098  #define __Pyx_GetBuffer PyObject_GetBuffer
2099  #define __Pyx_ReleaseBuffer PyBuffer_Release
2100 #endif
2101 
2102 
2103 /* BufferStructDeclare.proto */
2104 typedef struct {
2105  Py_ssize_t shape, strides, suboffsets;
2106 } __Pyx_Buf_DimInfo;
2107 typedef struct {
2108  size_t refcount;
2109  Py_buffer pybuffer;
2110 } __Pyx_Buffer;
2111 typedef struct {
2112  __Pyx_Buffer *rcbuffer;
2113  char *data;
2114  __Pyx_Buf_DimInfo diminfo[8];
2115 } __Pyx_LocalBuf_ND;
2116 
2117 /* MemviewSliceIsContig.proto */
2118 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2119 
2120 /* OverlappingSlices.proto */
2121 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2122  __Pyx_memviewslice *slice2,
2123  int ndim, size_t itemsize);
2124 
2125 /* Capsule.proto */
2126 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2127 
2128 /* GCCDiagnostics.proto */
2129 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2130 #define __Pyx_HAS_GCC_DIAGNOSTIC
2131 #endif
2132 
2133 /* IsLittleEndian.proto */
2134 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2135 
2136 /* BufferFormatCheck.proto */
2137 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2138 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2139  __Pyx_BufFmt_StackElem* stack,
2140  __Pyx_TypeInfo* type);
2141 
2142 /* TypeInfoCompare.proto */
2143 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2144 
2145 /* MemviewSliceValidateAndInit.proto */
2146 static int __Pyx_ValidateAndInit_memviewslice(
2147  int *axes_specs,
2148  int c_or_f_flag,
2149  int buf_flags,
2150  int ndim,
2151  __Pyx_TypeInfo *dtype,
2152  __Pyx_BufFmt_StackElem stack[],
2153  __Pyx_memviewslice *memviewslice,
2154  PyObject *original_obj);
2155 
2156 /* ObjectToMemviewSlice.proto */
2157 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2158 
2159 /* ObjectToMemviewSlice.proto */
2160 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2161 
2162 /* RealImag.proto */
2163 #if CYTHON_CCOMPLEX
2164  #ifdef __cplusplus
2165  #define __Pyx_CREAL(z) ((z).real())
2166  #define __Pyx_CIMAG(z) ((z).imag())
2167  #else
2168  #define __Pyx_CREAL(z) (__real__(z))
2169  #define __Pyx_CIMAG(z) (__imag__(z))
2170  #endif
2171 #else
2172  #define __Pyx_CREAL(z) ((z).real)
2173  #define __Pyx_CIMAG(z) ((z).imag)
2174 #endif
2175 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2176  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2177  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2178  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2179 #else
2180  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2181  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2182 #endif
2183 
2184 /* Arithmetic.proto */
2185 #if CYTHON_CCOMPLEX
2186  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2187  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2188  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2189  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2190  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2191  #define __Pyx_c_neg_float(a) (-(a))
2192  #ifdef __cplusplus
2193  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2194  #define __Pyx_c_conj_float(z) (::std::conj(z))
2195  #if 1
2196  #define __Pyx_c_abs_float(z) (::std::abs(z))
2197  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2198  #endif
2199  #else
2200  #define __Pyx_c_is_zero_float(z) ((z)==0)
2201  #define __Pyx_c_conj_float(z) (conjf(z))
2202  #if 1
2203  #define __Pyx_c_abs_float(z) (cabsf(z))
2204  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2205  #endif
2206  #endif
2207 #else
2208  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2209  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2210  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2211  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2212  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2213  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2214  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2215  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2216  #if 1
2217  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2218  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2219  #endif
2220 #endif
2221 
2222 /* Arithmetic.proto */
2223 #if CYTHON_CCOMPLEX
2224  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2225  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2226  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2227  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2228  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2229  #define __Pyx_c_neg_double(a) (-(a))
2230  #ifdef __cplusplus
2231  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2232  #define __Pyx_c_conj_double(z) (::std::conj(z))
2233  #if 1
2234  #define __Pyx_c_abs_double(z) (::std::abs(z))
2235  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2236  #endif
2237  #else
2238  #define __Pyx_c_is_zero_double(z) ((z)==0)
2239  #define __Pyx_c_conj_double(z) (conj(z))
2240  #if 1
2241  #define __Pyx_c_abs_double(z) (cabs(z))
2242  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2243  #endif
2244  #endif
2245 #else
2246  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2247  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2248  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2249  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2250  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2251  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2252  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2253  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2254  #if 1
2255  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2256  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2257  #endif
2258 #endif
2259 
2260 /* MemviewSliceCopyTemplate.proto */
2261 static __Pyx_memviewslice
2262 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2263  const char *mode, int ndim,
2264  size_t sizeof_dtype, int contig_flag,
2265  int dtype_is_object);
2266 
2267 /* CIntFromPy.proto */
2268 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2269 
2270 /* CIntFromPy.proto */
2271 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2272 
2273 /* CIntToPy.proto */
2274 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2275 
2276 /* CIntToPy.proto */
2277 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2278 
2279 /* CIntFromPy.proto */
2280 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2281 
2282 /* CheckBinaryVersion.proto */
2283 static int __Pyx_check_binary_version(void);
2284 
2285 /* InitStrings.proto */
2286 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2287 
2288 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2289 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2290 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2291 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2292 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2293 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2294 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2295 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2296 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2297 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2298 
2299 /* Module declarations from 'proteus' */
2300 
2301 /* Module declarations from 'cpython.buffer' */
2302 
2303 /* Module declarations from 'libc.string' */
2304 
2305 /* Module declarations from 'libc.stdio' */
2306 
2307 /* Module declarations from '__builtin__' */
2308 
2309 /* Module declarations from 'cpython.type' */
2310 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2311 
2312 /* Module declarations from 'cpython' */
2313 
2314 /* Module declarations from 'cpython.object' */
2315 
2316 /* Module declarations from 'cpython.ref' */
2317 
2318 /* Module declarations from 'cpython.mem' */
2319 
2320 /* Module declarations from 'numpy' */
2321 
2322 /* Module declarations from 'numpy' */
2323 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2324 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2325 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2326 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2327 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2328 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2329 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2330 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2331 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2332 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2333 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2334 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2335 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2336 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2337 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2338 
2339 /* Module declarations from 'proteus.superluWrappers' */
2340 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2341 
2342 /* Module declarations from 'cython.view' */
2343 
2344 /* Module declarations from 'cython' */
2345 
2346 /* Module declarations from 'csmoothers' */
2347 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2348 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2349 static PyTypeObject *__pyx_array_type = 0;
2350 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2351 static PyTypeObject *__pyx_memoryview_type = 0;
2352 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2353 static PyObject *generic = 0;
2354 static PyObject *strided = 0;
2355 static PyObject *indirect = 0;
2356 static PyObject *contiguous = 0;
2357 static PyObject *indirect_contiguous = 0;
2358 static int __pyx_memoryview_thread_locks_used;
2359 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2360 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2361 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2362 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2363 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2364 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2365 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2366 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cASMFactor *); /*proto*/
2367 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2368 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cBASMFactor *); /*proto*/
2369 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2370 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2371 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2372 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2373 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2374 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2375 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2376 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2377 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2378 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2379 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2380 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2381 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2382 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2383 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2384 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2385 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2386 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2387 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2388 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2389 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2390 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2391 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2392 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2393 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2394 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2395 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2396 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2397 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2398 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2399 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2400 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2401 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2402 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2403 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2404 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2405 #define __Pyx_MODULE_NAME "csmoothers"
2406 extern int __pyx_module_is_main_csmoothers;
2407 int __pyx_module_is_main_csmoothers = 0;
2408 
2409 /* Implementation of 'csmoothers' */
2410 static PyObject *__pyx_builtin_object;
2411 static PyObject *__pyx_builtin_TypeError;
2412 static PyObject *__pyx_builtin_ImportError;
2413 static PyObject *__pyx_builtin_ValueError;
2414 static PyObject *__pyx_builtin_MemoryError;
2415 static PyObject *__pyx_builtin_enumerate;
2416 static PyObject *__pyx_builtin_range;
2417 static PyObject *__pyx_builtin_Ellipsis;
2418 static PyObject *__pyx_builtin_id;
2419 static PyObject *__pyx_builtin_IndexError;
2420 static const char __pyx_k_A[] = "A";
2421 static const char __pyx_k_L[] = "L";
2422 static const char __pyx_k_M[] = "M";
2423 static const char __pyx_k_O[] = "O";
2424 static const char __pyx_k_R[] = "R";
2425 static const char __pyx_k_c[] = "c";
2426 static const char __pyx_k_w[] = "w";
2427 static const char __pyx_k_bs[] = "bs";
2428 static const char __pyx_k_dX[] = "dX";
2429 static const char __pyx_k_id[] = "id";
2430 static const char __pyx_k_nc[] = "nc";
2431 static const char __pyx_k_np[] = "np";
2432 static const char __pyx_k_nr[] = "nr";
2433 static const char __pyx_k_doc[] = "__doc__";
2434 static const char __pyx_k_new[] = "__new__";
2435 static const char __pyx_k_obj[] = "obj";
2436 static const char __pyx_k_tol[] = "tol";
2437 static const char __pyx_k_base[] = "base";
2438 static const char __pyx_k_dict[] = "__dict__";
2439 static const char __pyx_k_init[] = "__init__";
2440 static const char __pyx_k_main[] = "__main__";
2441 static const char __pyx_k_mode[] = "mode";
2442 static const char __pyx_k_name[] = "name";
2443 static const char __pyx_k_ndim[] = "ndim";
2444 static const char __pyx_k_pack[] = "pack";
2445 static const char __pyx_k_self[] = "self";
2446 static const char __pyx_k_size[] = "size";
2447 static const char __pyx_k_step[] = "step";
2448 static const char __pyx_k_stop[] = "stop";
2449 static const char __pyx_k_test[] = "__test__";
2450 static const char __pyx_k_ASCII[] = "ASCII";
2451 static const char __pyx_k_class[] = "__class__";
2452 static const char __pyx_k_error[] = "error";
2453 static const char __pyx_k_flags[] = "flags";
2454 static const char __pyx_k_numpy[] = "numpy";
2455 static const char __pyx_k_range[] = "range";
2456 static const char __pyx_k_shape[] = "shape";
2457 static const char __pyx_k_start[] = "start";
2458 static const char __pyx_k_encode[] = "encode";
2459 static const char __pyx_k_format[] = "format";
2460 static const char __pyx_k_import[] = "__import__";
2461 static const char __pyx_k_module[] = "__module__";
2462 static const char __pyx_k_name_2[] = "__name__";
2463 static const char __pyx_k_object[] = "object";
2464 static const char __pyx_k_pickle[] = "pickle";
2465 static const char __pyx_k_reduce[] = "__reduce__";
2466 static const char __pyx_k_struct[] = "struct";
2467 static const char __pyx_k_unpack[] = "unpack";
2468 static const char __pyx_k_update[] = "update";
2469 static const char __pyx_k_fortran[] = "fortran";
2470 static const char __pyx_k_memview[] = "memview";
2471 static const char __pyx_k_prepare[] = "__prepare__";
2472 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2473 static const char __pyx_k_getstate[] = "__getstate__";
2474 static const char __pyx_k_itemsize[] = "itemsize";
2475 static const char __pyx_k_pyx_type[] = "__pyx_type";
2476 static const char __pyx_k_qualname[] = "__qualname__";
2477 static const char __pyx_k_setstate[] = "__setstate__";
2478 static const char __pyx_k_ASMFactor[] = "ASMFactor";
2479 static const char __pyx_k_TypeError[] = "TypeError";
2480 static const char __pyx_k_asmFactor[] = "asmFactor";
2481 static const char __pyx_k_enumerate[] = "enumerate";
2482 static const char __pyx_k_metaclass[] = "__metaclass__";
2483 static const char __pyx_k_pyx_state[] = "__pyx_state";
2484 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2485 static const char __pyx_k_BASMFactor[] = "BASMFactor";
2486 static const char __pyx_k_IndexError[] = "IndexError";
2487 static const char __pyx_k_ValueError[] = "ValueError";
2488 static const char __pyx_k_basmFactor[] = "basmFactor";
2489 static const char __pyx_k_cASMFactor[] = "_cASMFactor";
2490 static const char __pyx_k_csmoothers[] = "csmoothers";
2491 static const char __pyx_k_node_order[] = "node_order";
2492 static const char __pyx_k_pyx_result[] = "__pyx_result";
2493 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2494 static const char __pyx_k_ImportError[] = "ImportError";
2495 static const char __pyx_k_MemoryError[] = "MemoryError";
2496 static const char __pyx_k_PickleError[] = "PickleError";
2497 static const char __pyx_k_cBASMFactor[] = "_cBASMFactor";
2498 static const char __pyx_k_asm_NR_solve[] = "asm_NR_solve";
2499 static const char __pyx_k_cASMFactor_2[] = "cASMFactor";
2500 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2501 static const char __pyx_k_stringsource[] = "stringsource";
2502 static const char __pyx_k_basm_NR_solve[] = "basm_NR_solve";
2503 static const char __pyx_k_cBASMFactor_2[] = "cBASMFactor";
2504 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2505 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2506 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2507 static const char __pyx_k_asm_NR_prepare[] = "asm_NR_prepare";
2508 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2509 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2510 static const char __pyx_k_basm_NR_prepare[] = "basm_NR_prepare";
2511 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2512 static const char __pyx_k_jacobi_NR_solve[] = "jacobi_NR_solve";
2513 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2514 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2515 static const char __pyx_k_ASMFactor___init[] = "ASMFactor.__init__";
2516 static const char __pyx_k_BASMFactor___init[] = "BASMFactor.__init__";
2517 static const char __pyx_k_jacobi_NR_prepare[] = "jacobi_NR_prepare";
2518 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2519 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2520 static const char __pyx_k_nl_jacobi_NR_solve[] = "nl_jacobi_NR_solve";
2521 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2522 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2523 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2524 static const char __pyx_k_gauss_seidel_NR_solve[] = "gauss_seidel_NR_solve";
2525 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2526 static const char __pyx_k_gauss_seidel_NR_preare[] = "gauss_seidel_NR_preare";
2527 static const char __pyx_k_proteus_csmoothers_pyx[] = "proteus/csmoothers.pyx";
2528 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2529 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2530 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2531 static const char __pyx_k_nl_gauss_seidel_NR_solve[] = "nl_gauss_seidel_NR_solve";
2532 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2533 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2534 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2535 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2536 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2537 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2538 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2539 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2540 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2541 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2542 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2543 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2544 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2545 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2546 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2547 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2548 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2549 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2550 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2551 static PyObject *__pyx_n_s_A;
2552 static PyObject *__pyx_n_s_ASCII;
2553 static PyObject *__pyx_n_s_ASMFactor;
2554 static PyObject *__pyx_n_s_ASMFactor___init;
2555 static PyObject *__pyx_n_s_BASMFactor;
2556 static PyObject *__pyx_n_s_BASMFactor___init;
2557 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2558 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2559 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2560 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2561 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2562 static PyObject *__pyx_n_s_Ellipsis;
2563 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2564 static PyObject *__pyx_n_s_ImportError;
2565 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2566 static PyObject *__pyx_n_s_IndexError;
2567 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2568 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2569 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2570 static PyObject *__pyx_n_s_L;
2571 static PyObject *__pyx_n_s_M;
2572 static PyObject *__pyx_n_s_MemoryError;
2573 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2574 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2575 static PyObject *__pyx_n_b_O;
2576 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2577 static PyObject *__pyx_n_s_PickleError;
2578 static PyObject *__pyx_n_s_R;
2579 static PyObject *__pyx_n_s_TypeError;
2580 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2581 static PyObject *__pyx_n_s_ValueError;
2582 static PyObject *__pyx_n_s_View_MemoryView;
2583 static PyObject *__pyx_n_s_allocate_buffer;
2584 static PyObject *__pyx_n_s_asmFactor;
2585 static PyObject *__pyx_n_s_asm_NR_prepare;
2586 static PyObject *__pyx_n_s_asm_NR_solve;
2587 static PyObject *__pyx_n_s_base;
2588 static PyObject *__pyx_n_s_basmFactor;
2589 static PyObject *__pyx_n_s_basm_NR_prepare;
2590 static PyObject *__pyx_n_s_basm_NR_solve;
2591 static PyObject *__pyx_n_s_bs;
2592 static PyObject *__pyx_n_s_c;
2593 static PyObject *__pyx_n_u_c;
2594 static PyObject *__pyx_n_s_cASMFactor;
2595 static PyObject *__pyx_n_s_cASMFactor_2;
2596 static PyObject *__pyx_n_s_cBASMFactor;
2597 static PyObject *__pyx_n_s_cBASMFactor_2;
2598 static PyObject *__pyx_n_s_cSparseMatrix;
2599 static PyObject *__pyx_n_s_class;
2600 static PyObject *__pyx_n_s_cline_in_traceback;
2601 static PyObject *__pyx_kp_s_contiguous_and_direct;
2602 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2603 static PyObject *__pyx_n_s_csmoothers;
2604 static PyObject *__pyx_n_s_dX;
2605 static PyObject *__pyx_n_s_dict;
2606 static PyObject *__pyx_n_s_doc;
2607 static PyObject *__pyx_n_s_dtype_is_object;
2608 static PyObject *__pyx_n_s_encode;
2609 static PyObject *__pyx_n_s_enumerate;
2610 static PyObject *__pyx_n_s_error;
2611 static PyObject *__pyx_n_s_flags;
2612 static PyObject *__pyx_n_s_format;
2613 static PyObject *__pyx_n_s_fortran;
2614 static PyObject *__pyx_n_u_fortran;
2615 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2616 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2617 static PyObject *__pyx_n_s_getstate;
2618 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2619 static PyObject *__pyx_n_s_id;
2620 static PyObject *__pyx_n_s_import;
2621 static PyObject *__pyx_n_s_init;
2622 static PyObject *__pyx_n_s_itemsize;
2623 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2624 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2625 static PyObject *__pyx_n_s_jacobi_NR_solve;
2626 static PyObject *__pyx_n_s_main;
2627 static PyObject *__pyx_n_s_memview;
2628 static PyObject *__pyx_n_s_metaclass;
2629 static PyObject *__pyx_n_s_mode;
2630 static PyObject *__pyx_n_s_module;
2631 static PyObject *__pyx_n_s_name;
2632 static PyObject *__pyx_n_s_name_2;
2633 static PyObject *__pyx_n_s_nc;
2634 static PyObject *__pyx_n_s_ndim;
2635 static PyObject *__pyx_n_s_new;
2636 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2637 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2638 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2639 static PyObject *__pyx_n_s_node_order;
2640 static PyObject *__pyx_n_s_np;
2641 static PyObject *__pyx_n_s_nr;
2642 static PyObject *__pyx_n_s_numpy;
2643 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2644 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2645 static PyObject *__pyx_n_s_obj;
2646 static PyObject *__pyx_n_s_object;
2647 static PyObject *__pyx_n_s_pack;
2648 static PyObject *__pyx_n_s_pickle;
2649 static PyObject *__pyx_n_s_prepare;
2650 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2651 static PyObject *__pyx_n_s_pyx_PickleError;
2652 static PyObject *__pyx_n_s_pyx_checksum;
2653 static PyObject *__pyx_n_s_pyx_getbuffer;
2654 static PyObject *__pyx_n_s_pyx_result;
2655 static PyObject *__pyx_n_s_pyx_state;
2656 static PyObject *__pyx_n_s_pyx_type;
2657 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2658 static PyObject *__pyx_n_s_pyx_vtable;
2659 static PyObject *__pyx_n_s_qualname;
2660 static PyObject *__pyx_n_s_range;
2661 static PyObject *__pyx_n_s_reduce;
2662 static PyObject *__pyx_n_s_reduce_cython;
2663 static PyObject *__pyx_n_s_reduce_ex;
2664 static PyObject *__pyx_n_s_self;
2665 static PyObject *__pyx_n_s_setstate;
2666 static PyObject *__pyx_n_s_setstate_cython;
2667 static PyObject *__pyx_n_s_shape;
2668 static PyObject *__pyx_n_s_size;
2669 static PyObject *__pyx_n_s_start;
2670 static PyObject *__pyx_n_s_step;
2671 static PyObject *__pyx_n_s_stop;
2672 static PyObject *__pyx_kp_s_strided_and_direct;
2673 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2674 static PyObject *__pyx_kp_s_strided_and_indirect;
2675 static PyObject *__pyx_kp_s_stringsource;
2676 static PyObject *__pyx_n_s_struct;
2677 static PyObject *__pyx_n_s_test;
2678 static PyObject *__pyx_n_s_tol;
2679 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2680 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2681 static PyObject *__pyx_n_s_unpack;
2682 static PyObject *__pyx_n_s_update;
2683 static PyObject *__pyx_n_s_w;
2684 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L); /* proto */
2685 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L); /* proto */
2686 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2687 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2688 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2689 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs); /* proto */
2690 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs); /* proto */
2691 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2692 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2693 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2694 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2695 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2696 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2697 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2698 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2699 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2700 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor); /* proto */
2701 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2702 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor); /* proto */
2703 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2704 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2705 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2706 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2707 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2708 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2709 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2710 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2711 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2712 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2713 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2714 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2715 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2716 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2717 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2718 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2719 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2720 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2721 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2722 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2723 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2724 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2725 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2726 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2727 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2728 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2729 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2730 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2731 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2732 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2733 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2734 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2735 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2736 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2737 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2738 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2739 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2740 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2741 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2742 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2743 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2744 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2745 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2746 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2747 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2748 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2749 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2750 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2751 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2752 static PyObject *__pyx_int_0;
2753 static PyObject *__pyx_int_1;
2754 static PyObject *__pyx_int_184977713;
2755 static PyObject *__pyx_int_neg_1;
2756 static PyObject *__pyx_tuple_;
2757 static PyObject *__pyx_tuple__2;
2758 static PyObject *__pyx_tuple__3;
2759 static PyObject *__pyx_tuple__4;
2760 static PyObject *__pyx_tuple__5;
2761 static PyObject *__pyx_tuple__6;
2762 static PyObject *__pyx_tuple__7;
2763 static PyObject *__pyx_tuple__8;
2764 static PyObject *__pyx_tuple__9;
2765 static PyObject *__pyx_slice__21;
2766 static PyObject *__pyx_tuple__10;
2767 static PyObject *__pyx_tuple__11;
2768 static PyObject *__pyx_tuple__12;
2769 static PyObject *__pyx_tuple__13;
2770 static PyObject *__pyx_tuple__14;
2771 static PyObject *__pyx_tuple__15;
2772 static PyObject *__pyx_tuple__16;
2773 static PyObject *__pyx_tuple__17;
2774 static PyObject *__pyx_tuple__18;
2775 static PyObject *__pyx_tuple__19;
2776 static PyObject *__pyx_tuple__20;
2777 static PyObject *__pyx_tuple__22;
2778 static PyObject *__pyx_tuple__23;
2779 static PyObject *__pyx_tuple__24;
2780 static PyObject *__pyx_tuple__25;
2781 static PyObject *__pyx_tuple__26;
2782 static PyObject *__pyx_tuple__28;
2783 static PyObject *__pyx_tuple__29;
2784 static PyObject *__pyx_tuple__31;
2785 static PyObject *__pyx_tuple__33;
2786 static PyObject *__pyx_tuple__35;
2787 static PyObject *__pyx_tuple__37;
2788 static PyObject *__pyx_tuple__39;
2789 static PyObject *__pyx_tuple__41;
2790 static PyObject *__pyx_tuple__43;
2791 static PyObject *__pyx_tuple__45;
2792 static PyObject *__pyx_tuple__47;
2793 static PyObject *__pyx_tuple__49;
2794 static PyObject *__pyx_tuple__51;
2795 static PyObject *__pyx_tuple__52;
2796 static PyObject *__pyx_tuple__53;
2797 static PyObject *__pyx_tuple__54;
2798 static PyObject *__pyx_tuple__55;
2799 static PyObject *__pyx_tuple__56;
2800 static PyObject *__pyx_codeobj__27;
2801 static PyObject *__pyx_codeobj__30;
2802 static PyObject *__pyx_codeobj__32;
2803 static PyObject *__pyx_codeobj__34;
2804 static PyObject *__pyx_codeobj__36;
2805 static PyObject *__pyx_codeobj__38;
2806 static PyObject *__pyx_codeobj__40;
2807 static PyObject *__pyx_codeobj__42;
2808 static PyObject *__pyx_codeobj__44;
2809 static PyObject *__pyx_codeobj__46;
2810 static PyObject *__pyx_codeobj__48;
2811 static PyObject *__pyx_codeobj__50;
2812 static PyObject *__pyx_codeobj__57;
2813 /* Late includes */
2814 
2815 /* "csmoothers.pyx":7
2816  * class ASMFactor(object):
2817  *
2818  * def __init__(self, L): # <<<<<<<<<<<<<<
2819  * self.L = L
2820  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2821  */
2822 
2823 /* Python wrapper */
2824 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2825 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2826 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2827  PyObject *__pyx_v_self = 0;
2828  PyObject *__pyx_v_L = 0;
2829  int __pyx_lineno = 0;
2830  const char *__pyx_filename = NULL;
2831  int __pyx_clineno = 0;
2832  PyObject *__pyx_r = 0;
2833  __Pyx_RefNannyDeclarations
2834  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2835  {
2836  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2837  PyObject* values[2] = {0,0};
2838  if (unlikely(__pyx_kwds)) {
2839  Py_ssize_t kw_args;
2840  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2841  switch (pos_args) {
2842  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2843  CYTHON_FALLTHROUGH;
2844  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2845  CYTHON_FALLTHROUGH;
2846  case 0: break;
2847  default: goto __pyx_L5_argtuple_error;
2848  }
2849  kw_args = PyDict_Size(__pyx_kwds);
2850  switch (pos_args) {
2851  case 0:
2852  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2853  else goto __pyx_L5_argtuple_error;
2854  CYTHON_FALLTHROUGH;
2855  case 1:
2856  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2857  else {
2858  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2859  }
2860  }
2861  if (unlikely(kw_args > 0)) {
2862  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2863  }
2864  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2865  goto __pyx_L5_argtuple_error;
2866  } else {
2867  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2868  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2869  }
2870  __pyx_v_self = values[0];
2871  __pyx_v_L = values[1];
2872  }
2873  goto __pyx_L4_argument_unpacking_done;
2874  __pyx_L5_argtuple_error:;
2875  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2876  __pyx_L3_error:;
2877  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2878  __Pyx_RefNannyFinishContext();
2879  return NULL;
2880  __pyx_L4_argument_unpacking_done:;
2881  __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2882 
2883  /* function exit code */
2884  __Pyx_RefNannyFinishContext();
2885  return __pyx_r;
2886 }
2887 
2888 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2889  PyObject *__pyx_r = NULL;
2890  __Pyx_RefNannyDeclarations
2891  PyObject *__pyx_t_1 = NULL;
2892  PyObject *__pyx_t_2 = NULL;
2893  int __pyx_lineno = 0;
2894  const char *__pyx_filename = NULL;
2895  int __pyx_clineno = 0;
2896  __Pyx_RefNannySetupContext("__init__", 0);
2897 
2898  /* "csmoothers.pyx":8
2899  *
2900  * def __init__(self, L):
2901  * self.L = L # <<<<<<<<<<<<<<
2902  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2903  *
2904  */
2905  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
2906 
2907  /* "csmoothers.pyx":9
2908  * def __init__(self, L):
2909  * self.L = L
2910  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix) # <<<<<<<<<<<<<<
2911  *
2912  * cdef class cASMFactor(object):
2913  */
2914  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2915  __Pyx_GOTREF(__pyx_t_1);
2916  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
2917  __Pyx_GOTREF(__pyx_t_2);
2918  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2919  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
2920  __Pyx_GOTREF(__pyx_t_1);
2921  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2922  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
2923  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2924 
2925  /* "csmoothers.pyx":7
2926  * class ASMFactor(object):
2927  *
2928  * def __init__(self, L): # <<<<<<<<<<<<<<
2929  * self.L = L
2930  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2931  */
2932 
2933  /* function exit code */
2934  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2935  goto __pyx_L0;
2936  __pyx_L1_error:;
2937  __Pyx_XDECREF(__pyx_t_1);
2938  __Pyx_XDECREF(__pyx_t_2);
2939  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2940  __pyx_r = NULL;
2941  __pyx_L0:;
2942  __Pyx_XGIVEREF(__pyx_r);
2943  __Pyx_RefNannyFinishContext();
2944  return __pyx_r;
2945 }
2946 
2947 /* "csmoothers.pyx":13
2948  * cdef class cASMFactor(object):
2949  *
2950  * def __cinit__(self, # <<<<<<<<<<<<<<
2951  * superluWrappers.cSparseMatrix L):
2952  * cdef int rval = 0
2953  */
2954 
2955 /* Python wrapper */
2956 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2957 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2958  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
2959  int __pyx_lineno = 0;
2960  const char *__pyx_filename = NULL;
2961  int __pyx_clineno = 0;
2962  int __pyx_r;
2963  __Pyx_RefNannyDeclarations
2964  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2965  {
2966  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
2967  PyObject* values[1] = {0};
2968  if (unlikely(__pyx_kwds)) {
2969  Py_ssize_t kw_args;
2970  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2971  switch (pos_args) {
2972  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2973  CYTHON_FALLTHROUGH;
2974  case 0: break;
2975  default: goto __pyx_L5_argtuple_error;
2976  }
2977  kw_args = PyDict_Size(__pyx_kwds);
2978  switch (pos_args) {
2979  case 0:
2980  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2981  else goto __pyx_L5_argtuple_error;
2982  }
2983  if (unlikely(kw_args > 0)) {
2984  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2985  }
2986  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2987  goto __pyx_L5_argtuple_error;
2988  } else {
2989  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2990  }
2991  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
2992  }
2993  goto __pyx_L4_argument_unpacking_done;
2994  __pyx_L5_argtuple_error:;
2995  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2996  __pyx_L3_error:;
2997  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2998  __Pyx_RefNannyFinishContext();
2999  return -1;
3000  __pyx_L4_argument_unpacking_done:;
3001  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
3002  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
3003 
3004  /* function exit code */
3005  goto __pyx_L0;
3006  __pyx_L1_error:;
3007  __pyx_r = -1;
3008  __pyx_L0:;
3009  __Pyx_RefNannyFinishContext();
3010  return __pyx_r;
3011 }
3012 
3013 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
3014  int __pyx_v_rval;
3015  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3016  int __pyx_r;
3017  __Pyx_RefNannyDeclarations
3018  PyObject *__pyx_t_1 = NULL;
3019  int __pyx_t_2;
3020  int __pyx_lineno = 0;
3021  const char *__pyx_filename = NULL;
3022  int __pyx_clineno = 0;
3023  __Pyx_RefNannySetupContext("__cinit__", 0);
3024 
3025  /* "csmoothers.pyx":15
3026  * def __cinit__(self,
3027  * superluWrappers.cSparseMatrix L):
3028  * cdef int rval = 0 # <<<<<<<<<<<<<<
3029  * cdef SuperMatrix AS
3030  * AS.Stype = superluWrappers._SLU_NR
3031  */
3032  __pyx_v_rval = 0;
3033 
3034  /* "csmoothers.pyx":17
3035  * cdef int rval = 0
3036  * cdef SuperMatrix AS
3037  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3038  * AS.Dtype = superluWrappers._SLU_D
3039  * AS.Mtype = superluWrappers._SLU_GE
3040  */
3041  __pyx_v_AS.Stype = SLU_NR;
3042 
3043  /* "csmoothers.pyx":18
3044  * cdef SuperMatrix AS
3045  * AS.Stype = superluWrappers._SLU_NR
3046  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3047  * AS.Mtype = superluWrappers._SLU_GE
3048  * AS.nrow = L.nr
3049  */
3050  __pyx_v_AS.Dtype = SLU_D;
3051 
3052  /* "csmoothers.pyx":19
3053  * AS.Stype = superluWrappers._SLU_NR
3054  * AS.Dtype = superluWrappers._SLU_D
3055  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3056  * AS.nrow = L.nr
3057  * AS.ncol = L.nc
3058  */
3059  __pyx_v_AS.Mtype = SLU_GE;
3060 
3061  /* "csmoothers.pyx":20
3062  * AS.Dtype = superluWrappers._SLU_D
3063  * AS.Mtype = superluWrappers._SLU_GE
3064  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3065  * AS.ncol = L.nc
3066  * AS.Store = &L.A
3067  */
3068  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3069  __Pyx_GOTREF(__pyx_t_1);
3070  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3071  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3072  __pyx_v_AS.nrow = __pyx_t_2;
3073 
3074  /* "csmoothers.pyx":21
3075  * AS.Mtype = superluWrappers._SLU_GE
3076  * AS.nrow = L.nr
3077  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3078  * AS.Store = &L.A
3079  * rval = casm_NR_init(&AS,
3080  */
3081  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3082  __Pyx_GOTREF(__pyx_t_1);
3083  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3084  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3085  __pyx_v_AS.ncol = __pyx_t_2;
3086 
3087  /* "csmoothers.pyx":22
3088  * AS.nrow = L.nr
3089  * AS.ncol = L.nc
3090  * AS.Store = &L.A # <<<<<<<<<<<<<<
3091  * rval = casm_NR_init(&AS,
3092  * &self.subdomain_dim,
3093  */
3094  __pyx_v_AS.Store = (&__pyx_v_L->A);
3095 
3096  /* "csmoothers.pyx":23
3097  * AS.ncol = L.nc
3098  * AS.Store = &L.A
3099  * rval = casm_NR_init(&AS, # <<<<<<<<<<<<<<
3100  * &self.subdomain_dim,
3101  * &self.l2g_L,
3102  */
3103  __pyx_v_rval = asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3104 
3105  /* "csmoothers.pyx":30
3106  * &self.subdomain_dX,
3107  * &self.subdomain_pivots)
3108  * assert rval == 0 # <<<<<<<<<<<<<<
3109  *
3110  * def __dealloc__(self):
3111  */
3112  #ifndef CYTHON_WITHOUT_ASSERTIONS
3113  if (unlikely(!Py_OptimizeFlag)) {
3114  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3115  PyErr_SetNone(PyExc_AssertionError);
3116  __PYX_ERR(0, 30, __pyx_L1_error)
3117  }
3118  }
3119  #endif
3120 
3121  /* "csmoothers.pyx":13
3122  * cdef class cASMFactor(object):
3123  *
3124  * def __cinit__(self, # <<<<<<<<<<<<<<
3125  * superluWrappers.cSparseMatrix L):
3126  * cdef int rval = 0
3127  */
3128 
3129  /* function exit code */
3130  __pyx_r = 0;
3131  goto __pyx_L0;
3132  __pyx_L1_error:;
3133  __Pyx_XDECREF(__pyx_t_1);
3134  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3135  __pyx_r = -1;
3136  __pyx_L0:;
3137  __Pyx_RefNannyFinishContext();
3138  return __pyx_r;
3139 }
3140 
3141 /* "csmoothers.pyx":32
3142  * assert rval == 0
3143  *
3144  * def __dealloc__(self): # <<<<<<<<<<<<<<
3145  * casm_NR_free(self.N,
3146  * self.subdomain_dim,
3147  */
3148 
3149 /* Python wrapper */
3150 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3151 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3152  __Pyx_RefNannyDeclarations
3153  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3154  __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3155 
3156  /* function exit code */
3157  __Pyx_RefNannyFinishContext();
3158 }
3159 
3160 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3161  __Pyx_RefNannyDeclarations
3162  __Pyx_RefNannySetupContext("__dealloc__", 0);
3163 
3164  /* "csmoothers.pyx":33
3165  *
3166  * def __dealloc__(self):
3167  * casm_NR_free(self.N, # <<<<<<<<<<<<<<
3168  * self.subdomain_dim,
3169  * self.l2g_L,
3170  */
3171  asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3172 
3173  /* "csmoothers.pyx":32
3174  * assert rval == 0
3175  *
3176  * def __dealloc__(self): # <<<<<<<<<<<<<<
3177  * casm_NR_free(self.N,
3178  * self.subdomain_dim,
3179  */
3180 
3181  /* function exit code */
3182  __Pyx_RefNannyFinishContext();
3183 }
3184 
3185 /* "(tree fragment)":1
3186  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3187  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3188  * def __setstate_cython__(self, __pyx_state):
3189  */
3190 
3191 /* Python wrapper */
3192 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3193 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3194  PyObject *__pyx_r = 0;
3195  __Pyx_RefNannyDeclarations
3196  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3197  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3198 
3199  /* function exit code */
3200  __Pyx_RefNannyFinishContext();
3201  return __pyx_r;
3202 }
3203 
3204 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3205  PyObject *__pyx_r = NULL;
3206  __Pyx_RefNannyDeclarations
3207  PyObject *__pyx_t_1 = NULL;
3208  int __pyx_lineno = 0;
3209  const char *__pyx_filename = NULL;
3210  int __pyx_clineno = 0;
3211  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3212 
3213  /* "(tree fragment)":2
3214  * def __reduce_cython__(self):
3215  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3216  * def __setstate_cython__(self, __pyx_state):
3217  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3218  */
3219  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3220  __Pyx_GOTREF(__pyx_t_1);
3221  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3222  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3223  __PYX_ERR(1, 2, __pyx_L1_error)
3224 
3225  /* "(tree fragment)":1
3226  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3227  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3228  * def __setstate_cython__(self, __pyx_state):
3229  */
3230 
3231  /* function exit code */
3232  __pyx_L1_error:;
3233  __Pyx_XDECREF(__pyx_t_1);
3234  __Pyx_AddTraceback("csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3235  __pyx_r = NULL;
3236  __Pyx_XGIVEREF(__pyx_r);
3237  __Pyx_RefNannyFinishContext();
3238  return __pyx_r;
3239 }
3240 
3241 /* "(tree fragment)":3
3242  * def __reduce_cython__(self):
3243  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3244  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3245  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3246  */
3247 
3248 /* Python wrapper */
3249 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3250 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3251  PyObject *__pyx_r = 0;
3252  __Pyx_RefNannyDeclarations
3253  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3254  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3255 
3256  /* function exit code */
3257  __Pyx_RefNannyFinishContext();
3258  return __pyx_r;
3259 }
3260 
3261 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3262  PyObject *__pyx_r = NULL;
3263  __Pyx_RefNannyDeclarations
3264  PyObject *__pyx_t_1 = NULL;
3265  int __pyx_lineno = 0;
3266  const char *__pyx_filename = NULL;
3267  int __pyx_clineno = 0;
3268  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3269 
3270  /* "(tree fragment)":4
3271  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3272  * def __setstate_cython__(self, __pyx_state):
3273  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3274  */
3275  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3276  __Pyx_GOTREF(__pyx_t_1);
3277  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3278  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3279  __PYX_ERR(1, 4, __pyx_L1_error)
3280 
3281  /* "(tree fragment)":3
3282  * def __reduce_cython__(self):
3283  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3284  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3285  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3286  */
3287 
3288  /* function exit code */
3289  __pyx_L1_error:;
3290  __Pyx_XDECREF(__pyx_t_1);
3291  __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3292  __pyx_r = NULL;
3293  __Pyx_XGIVEREF(__pyx_r);
3294  __Pyx_RefNannyFinishContext();
3295  return __pyx_r;
3296 }
3297 
3298 /* "csmoothers.pyx":44
3299  * class BASMFactor(object):
3300  *
3301  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3302  * self.L = L
3303  * self.bs = bs
3304  */
3305 
3306 /* Python wrapper */
3307 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3308 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3309 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3310  PyObject *__pyx_v_self = 0;
3311  PyObject *__pyx_v_L = 0;
3312  PyObject *__pyx_v_bs = 0;
3313  int __pyx_lineno = 0;
3314  const char *__pyx_filename = NULL;
3315  int __pyx_clineno = 0;
3316  PyObject *__pyx_r = 0;
3317  __Pyx_RefNannyDeclarations
3318  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3319  {
3320  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3321  PyObject* values[3] = {0,0,0};
3322  if (unlikely(__pyx_kwds)) {
3323  Py_ssize_t kw_args;
3324  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3325  switch (pos_args) {
3326  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3327  CYTHON_FALLTHROUGH;
3328  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3329  CYTHON_FALLTHROUGH;
3330  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3331  CYTHON_FALLTHROUGH;
3332  case 0: break;
3333  default: goto __pyx_L5_argtuple_error;
3334  }
3335  kw_args = PyDict_Size(__pyx_kwds);
3336  switch (pos_args) {
3337  case 0:
3338  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3339  else goto __pyx_L5_argtuple_error;
3340  CYTHON_FALLTHROUGH;
3341  case 1:
3342  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3343  else {
3344  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3345  }
3346  CYTHON_FALLTHROUGH;
3347  case 2:
3348  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3349  else {
3350  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3351  }
3352  }
3353  if (unlikely(kw_args > 0)) {
3354  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3355  }
3356  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3357  goto __pyx_L5_argtuple_error;
3358  } else {
3359  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3360  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3361  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3362  }
3363  __pyx_v_self = values[0];
3364  __pyx_v_L = values[1];
3365  __pyx_v_bs = values[2];
3366  }
3367  goto __pyx_L4_argument_unpacking_done;
3368  __pyx_L5_argtuple_error:;
3369  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3370  __pyx_L3_error:;
3371  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3372  __Pyx_RefNannyFinishContext();
3373  return NULL;
3374  __pyx_L4_argument_unpacking_done:;
3375  __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3376 
3377  /* function exit code */
3378  __Pyx_RefNannyFinishContext();
3379  return __pyx_r;
3380 }
3381 
3382 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3383  PyObject *__pyx_r = NULL;
3384  __Pyx_RefNannyDeclarations
3385  PyObject *__pyx_t_1 = NULL;
3386  PyObject *__pyx_t_2 = NULL;
3387  PyObject *__pyx_t_3 = NULL;
3388  int __pyx_lineno = 0;
3389  const char *__pyx_filename = NULL;
3390  int __pyx_clineno = 0;
3391  __Pyx_RefNannySetupContext("__init__", 0);
3392 
3393  /* "csmoothers.pyx":45
3394  *
3395  * def __init__(self, L, bs):
3396  * self.L = L # <<<<<<<<<<<<<<
3397  * self.bs = bs
3398  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3399  */
3400  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3401 
3402  /* "csmoothers.pyx":46
3403  * def __init__(self, L, bs):
3404  * self.L = L
3405  * self.bs = bs # <<<<<<<<<<<<<<
3406  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3407  * self.bs)
3408  */
3409  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3410 
3411  /* "csmoothers.pyx":47
3412  * self.L = L
3413  * self.bs = bs
3414  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3415  * self.bs)
3416  *
3417  */
3418  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3419  __Pyx_GOTREF(__pyx_t_1);
3420  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3421  __Pyx_GOTREF(__pyx_t_2);
3422  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3423 
3424  /* "csmoothers.pyx":48
3425  * self.bs = bs
3426  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3427  * self.bs) # <<<<<<<<<<<<<<
3428  *
3429  * cdef class cBASMFactor(object):
3430  */
3431  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3432  __Pyx_GOTREF(__pyx_t_1);
3433 
3434  /* "csmoothers.pyx":47
3435  * self.L = L
3436  * self.bs = bs
3437  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3438  * self.bs)
3439  *
3440  */
3441  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3442  __Pyx_GOTREF(__pyx_t_3);
3443  __Pyx_GIVEREF(__pyx_t_2);
3444  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3445  __Pyx_GIVEREF(__pyx_t_1);
3446  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3447  __pyx_t_2 = 0;
3448  __pyx_t_1 = 0;
3449  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3450  __Pyx_GOTREF(__pyx_t_1);
3451  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3452  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3453  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3454 
3455  /* "csmoothers.pyx":44
3456  * class BASMFactor(object):
3457  *
3458  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3459  * self.L = L
3460  * self.bs = bs
3461  */
3462 
3463  /* function exit code */
3464  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3465  goto __pyx_L0;
3466  __pyx_L1_error:;
3467  __Pyx_XDECREF(__pyx_t_1);
3468  __Pyx_XDECREF(__pyx_t_2);
3469  __Pyx_XDECREF(__pyx_t_3);
3470  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3471  __pyx_r = NULL;
3472  __pyx_L0:;
3473  __Pyx_XGIVEREF(__pyx_r);
3474  __Pyx_RefNannyFinishContext();
3475  return __pyx_r;
3476 }
3477 
3478 /* "csmoothers.pyx":52
3479  * cdef class cBASMFactor(object):
3480  *
3481  * def __cinit__(self, # <<<<<<<<<<<<<<
3482  * superluWrappers.cSparseMatrix L,
3483  * int bs):
3484  */
3485 
3486 /* Python wrapper */
3487 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3488 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3489  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3490  int __pyx_v_bs;
3491  int __pyx_lineno = 0;
3492  const char *__pyx_filename = NULL;
3493  int __pyx_clineno = 0;
3494  int __pyx_r;
3495  __Pyx_RefNannyDeclarations
3496  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3497  {
3498  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3499  PyObject* values[2] = {0,0};
3500  if (unlikely(__pyx_kwds)) {
3501  Py_ssize_t kw_args;
3502  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3503  switch (pos_args) {
3504  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3505  CYTHON_FALLTHROUGH;
3506  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3507  CYTHON_FALLTHROUGH;
3508  case 0: break;
3509  default: goto __pyx_L5_argtuple_error;
3510  }
3511  kw_args = PyDict_Size(__pyx_kwds);
3512  switch (pos_args) {
3513  case 0:
3514  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3515  else goto __pyx_L5_argtuple_error;
3516  CYTHON_FALLTHROUGH;
3517  case 1:
3518  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3519  else {
3520  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3521  }
3522  }
3523  if (unlikely(kw_args > 0)) {
3524  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3525  }
3526  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3527  goto __pyx_L5_argtuple_error;
3528  } else {
3529  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3530  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3531  }
3532  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3533  __pyx_v_bs = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3534  }
3535  goto __pyx_L4_argument_unpacking_done;
3536  __pyx_L5_argtuple_error:;
3537  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3538  __pyx_L3_error:;
3539  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3540  __Pyx_RefNannyFinishContext();
3541  return -1;
3542  __pyx_L4_argument_unpacking_done:;
3543  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3544  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3545 
3546  /* function exit code */
3547  goto __pyx_L0;
3548  __pyx_L1_error:;
3549  __pyx_r = -1;
3550  __pyx_L0:;
3551  __Pyx_RefNannyFinishContext();
3552  return __pyx_r;
3553 }
3554 
3555 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs) {
3556  int __pyx_v_rval;
3557  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3558  int __pyx_r;
3559  __Pyx_RefNannyDeclarations
3560  PyObject *__pyx_t_1 = NULL;
3561  int __pyx_t_2;
3562  int __pyx_lineno = 0;
3563  const char *__pyx_filename = NULL;
3564  int __pyx_clineno = 0;
3565  __Pyx_RefNannySetupContext("__cinit__", 0);
3566 
3567  /* "csmoothers.pyx":55
3568  * superluWrappers.cSparseMatrix L,
3569  * int bs):
3570  * cdef int rval = 0 # <<<<<<<<<<<<<<
3571  * cdef SuperMatrix AS
3572  * AS.Stype = superluWrappers._SLU_NR
3573  */
3574  __pyx_v_rval = 0;
3575 
3576  /* "csmoothers.pyx":57
3577  * cdef int rval = 0
3578  * cdef SuperMatrix AS
3579  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3580  * AS.Dtype = superluWrappers._SLU_D
3581  * AS.Mtype = superluWrappers._SLU_GE
3582  */
3583  __pyx_v_AS.Stype = SLU_NR;
3584 
3585  /* "csmoothers.pyx":58
3586  * cdef SuperMatrix AS
3587  * AS.Stype = superluWrappers._SLU_NR
3588  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3589  * AS.Mtype = superluWrappers._SLU_GE
3590  * AS.nrow = L.nr
3591  */
3592  __pyx_v_AS.Dtype = SLU_D;
3593 
3594  /* "csmoothers.pyx":59
3595  * AS.Stype = superluWrappers._SLU_NR
3596  * AS.Dtype = superluWrappers._SLU_D
3597  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3598  * AS.nrow = L.nr
3599  * AS.ncol = L.nc
3600  */
3601  __pyx_v_AS.Mtype = SLU_GE;
3602 
3603  /* "csmoothers.pyx":60
3604  * AS.Dtype = superluWrappers._SLU_D
3605  * AS.Mtype = superluWrappers._SLU_GE
3606  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3607  * AS.ncol = L.nc
3608  * AS.Store = &L.A
3609  */
3610  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3611  __Pyx_GOTREF(__pyx_t_1);
3612  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3613  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3614  __pyx_v_AS.nrow = __pyx_t_2;
3615 
3616  /* "csmoothers.pyx":61
3617  * AS.Mtype = superluWrappers._SLU_GE
3618  * AS.nrow = L.nr
3619  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3620  * AS.Store = &L.A
3621  * rval = cbasm_NR_init(bs,
3622  */
3623  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3624  __Pyx_GOTREF(__pyx_t_1);
3625  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3626  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3627  __pyx_v_AS.ncol = __pyx_t_2;
3628 
3629  /* "csmoothers.pyx":62
3630  * AS.nrow = L.nr
3631  * AS.ncol = L.nc
3632  * AS.Store = &L.A # <<<<<<<<<<<<<<
3633  * rval = cbasm_NR_init(bs,
3634  * &AS,
3635  */
3636  __pyx_v_AS.Store = (&__pyx_v_L->A);
3637 
3638  /* "csmoothers.pyx":63
3639  * AS.ncol = L.nc
3640  * AS.Store = &L.A
3641  * rval = cbasm_NR_init(bs, # <<<<<<<<<<<<<<
3642  * &AS,
3643  * &self.subdomain_dim,
3644  */
3645  __pyx_v_rval = basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3646 
3647  /* "csmoothers.pyx":72
3648  * &self.subdomain_pivots,
3649  * &self.subdomain_col_pivots)
3650  * assert rval == 0 # <<<<<<<<<<<<<<
3651  *
3652  * def __dealloc__(self):
3653  */
3654  #ifndef CYTHON_WITHOUT_ASSERTIONS
3655  if (unlikely(!Py_OptimizeFlag)) {
3656  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3657  PyErr_SetNone(PyExc_AssertionError);
3658  __PYX_ERR(0, 72, __pyx_L1_error)
3659  }
3660  }
3661  #endif
3662 
3663  /* "csmoothers.pyx":52
3664  * cdef class cBASMFactor(object):
3665  *
3666  * def __cinit__(self, # <<<<<<<<<<<<<<
3667  * superluWrappers.cSparseMatrix L,
3668  * int bs):
3669  */
3670 
3671  /* function exit code */
3672  __pyx_r = 0;
3673  goto __pyx_L0;
3674  __pyx_L1_error:;
3675  __Pyx_XDECREF(__pyx_t_1);
3676  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3677  __pyx_r = -1;
3678  __pyx_L0:;
3679  __Pyx_RefNannyFinishContext();
3680  return __pyx_r;
3681 }
3682 
3683 /* "csmoothers.pyx":74
3684  * assert rval == 0
3685  *
3686  * def __dealloc__(self): # <<<<<<<<<<<<<<
3687  * cbasm_NR_free(self.N,
3688  * self.subdomain_dim,
3689  */
3690 
3691 /* Python wrapper */
3692 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3693 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3694  __Pyx_RefNannyDeclarations
3695  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3696  __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3697 
3698  /* function exit code */
3699  __Pyx_RefNannyFinishContext();
3700 }
3701 
3702 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3703  __Pyx_RefNannyDeclarations
3704  __Pyx_RefNannySetupContext("__dealloc__", 0);
3705 
3706  /* "csmoothers.pyx":75
3707  *
3708  * def __dealloc__(self):
3709  * cbasm_NR_free(self.N, # <<<<<<<<<<<<<<
3710  * self.subdomain_dim,
3711  * self.l2g_L,
3712  */
3713  basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3714 
3715  /* "csmoothers.pyx":74
3716  * assert rval == 0
3717  *
3718  * def __dealloc__(self): # <<<<<<<<<<<<<<
3719  * cbasm_NR_free(self.N,
3720  * self.subdomain_dim,
3721  */
3722 
3723  /* function exit code */
3724  __Pyx_RefNannyFinishContext();
3725 }
3726 
3727 /* "(tree fragment)":1
3728  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3729  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3730  * def __setstate_cython__(self, __pyx_state):
3731  */
3732 
3733 /* Python wrapper */
3734 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3735 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3736  PyObject *__pyx_r = 0;
3737  __Pyx_RefNannyDeclarations
3738  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3739  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3740 
3741  /* function exit code */
3742  __Pyx_RefNannyFinishContext();
3743  return __pyx_r;
3744 }
3745 
3746 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3747  PyObject *__pyx_r = NULL;
3748  __Pyx_RefNannyDeclarations
3749  PyObject *__pyx_t_1 = NULL;
3750  int __pyx_lineno = 0;
3751  const char *__pyx_filename = NULL;
3752  int __pyx_clineno = 0;
3753  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3754 
3755  /* "(tree fragment)":2
3756  * def __reduce_cython__(self):
3757  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3758  * def __setstate_cython__(self, __pyx_state):
3759  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3760  */
3761  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3762  __Pyx_GOTREF(__pyx_t_1);
3763  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3764  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3765  __PYX_ERR(1, 2, __pyx_L1_error)
3766 
3767  /* "(tree fragment)":1
3768  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3769  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3770  * def __setstate_cython__(self, __pyx_state):
3771  */
3772 
3773  /* function exit code */
3774  __pyx_L1_error:;
3775  __Pyx_XDECREF(__pyx_t_1);
3776  __Pyx_AddTraceback("csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3777  __pyx_r = NULL;
3778  __Pyx_XGIVEREF(__pyx_r);
3779  __Pyx_RefNannyFinishContext();
3780  return __pyx_r;
3781 }
3782 
3783 /* "(tree fragment)":3
3784  * def __reduce_cython__(self):
3785  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3786  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3787  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3788  */
3789 
3790 /* Python wrapper */
3791 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3792 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3793  PyObject *__pyx_r = 0;
3794  __Pyx_RefNannyDeclarations
3795  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3796  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3797 
3798  /* function exit code */
3799  __Pyx_RefNannyFinishContext();
3800  return __pyx_r;
3801 }
3802 
3803 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3804  PyObject *__pyx_r = NULL;
3805  __Pyx_RefNannyDeclarations
3806  PyObject *__pyx_t_1 = NULL;
3807  int __pyx_lineno = 0;
3808  const char *__pyx_filename = NULL;
3809  int __pyx_clineno = 0;
3810  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3811 
3812  /* "(tree fragment)":4
3813  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3814  * def __setstate_cython__(self, __pyx_state):
3815  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3816  */
3817  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3818  __Pyx_GOTREF(__pyx_t_1);
3819  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3820  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3821  __PYX_ERR(1, 4, __pyx_L1_error)
3822 
3823  /* "(tree fragment)":3
3824  * def __reduce_cython__(self):
3825  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3826  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3827  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3828  */
3829 
3830  /* function exit code */
3831  __pyx_L1_error:;
3832  __Pyx_XDECREF(__pyx_t_1);
3833  __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3834  __pyx_r = NULL;
3835  __Pyx_XGIVEREF(__pyx_r);
3836  __Pyx_RefNannyFinishContext();
3837  return __pyx_r;
3838 }
3839 
3840 /* "csmoothers.pyx":84
3841  * self.subdomain_col_pivots)
3842  *
3843  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3844  * """
3845  *
3846  */
3847 
3848 /* Python wrapper */
3849 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3850 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3851 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {"jacobi_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3852 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3853  PyObject *__pyx_v_A = 0;
3854  PyObject *__pyx_v_w = 0;
3855  PyObject *__pyx_v_tol = 0;
3856  PyObject *__pyx_v_M = 0;
3857  int __pyx_lineno = 0;
3858  const char *__pyx_filename = NULL;
3859  int __pyx_clineno = 0;
3860  PyObject *__pyx_r = 0;
3861  __Pyx_RefNannyDeclarations
3862  __Pyx_RefNannySetupContext("jacobi_NR_prepare (wrapper)", 0);
3863  {
3864  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3865  PyObject* values[4] = {0,0,0,0};
3866  if (unlikely(__pyx_kwds)) {
3867  Py_ssize_t kw_args;
3868  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3869  switch (pos_args) {
3870  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3871  CYTHON_FALLTHROUGH;
3872  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3873  CYTHON_FALLTHROUGH;
3874  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3875  CYTHON_FALLTHROUGH;
3876  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3877  CYTHON_FALLTHROUGH;
3878  case 0: break;
3879  default: goto __pyx_L5_argtuple_error;
3880  }
3881  kw_args = PyDict_Size(__pyx_kwds);
3882  switch (pos_args) {
3883  case 0:
3884  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3885  else goto __pyx_L5_argtuple_error;
3886  CYTHON_FALLTHROUGH;
3887  case 1:
3888  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3889  else {
3890  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3891  }
3892  CYTHON_FALLTHROUGH;
3893  case 2:
3894  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3895  else {
3896  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3897  }
3898  CYTHON_FALLTHROUGH;
3899  case 3:
3900  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3901  else {
3902  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3903  }
3904  }
3905  if (unlikely(kw_args > 0)) {
3906  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
3907  }
3908  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3909  goto __pyx_L5_argtuple_error;
3910  } else {
3911  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3912  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3913  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3914  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3915  }
3916  __pyx_v_A = values[0];
3917  __pyx_v_w = values[1];
3918  __pyx_v_tol = values[2];
3919  __pyx_v_M = values[3];
3920  }
3921  goto __pyx_L4_argument_unpacking_done;
3922  __pyx_L5_argtuple_error:;
3923  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
3924  __pyx_L3_error:;
3925  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3926  __Pyx_RefNannyFinishContext();
3927  return NULL;
3928  __pyx_L4_argument_unpacking_done:;
3929  __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
3930 
3931  /* function exit code */
3932  __Pyx_RefNannyFinishContext();
3933  return __pyx_r;
3934 }
3935 
3936 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
3937  PyObject *__pyx_r = NULL;
3938  __Pyx_RefNannyDeclarations
3939  PyObject *__pyx_t_1 = NULL;
3940  double __pyx_t_2;
3941  double __pyx_t_3;
3942  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
3943  int __pyx_lineno = 0;
3944  const char *__pyx_filename = NULL;
3945  int __pyx_clineno = 0;
3946  __Pyx_RefNannySetupContext("jacobi_NR_prepare", 0);
3947 
3948  /* "csmoothers.pyx":94
3949  * M : np.array
3950  * """
3951  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
3952  *
3953  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm,
3954  */
3955  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3956  __Pyx_GOTREF(__pyx_t_1);
3957  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
3958  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3959  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
3960  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
3961  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
3962  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3963  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3964  __pyx_t_4.memview = NULL;
3965  __pyx_t_4.data = NULL;
3966 
3967  /* "csmoothers.pyx":84
3968  * self.subdomain_col_pivots)
3969  *
3970  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3971  * """
3972  *
3973  */
3974 
3975  /* function exit code */
3976  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3977  goto __pyx_L0;
3978  __pyx_L1_error:;
3979  __Pyx_XDECREF(__pyx_t_1);
3980  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
3981  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
3982  __pyx_r = NULL;
3983  __pyx_L0:;
3984  __Pyx_XGIVEREF(__pyx_r);
3985  __Pyx_RefNannyFinishContext();
3986  return __pyx_r;
3987 }
3988 
3989 /* "csmoothers.pyx":96
3990  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
3991  *
3992  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
3993  * double w,
3994  * double tol,
3995  */
3996 
3997 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
3998  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3999  __Pyx_RefNannyDeclarations
4000  PyObject *__pyx_t_1 = NULL;
4001  int __pyx_t_2;
4002  Py_ssize_t __pyx_t_3;
4003  int __pyx_lineno = 0;
4004  const char *__pyx_filename = NULL;
4005  int __pyx_clineno = 0;
4006  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_prepare", 0);
4007 
4008  /* "csmoothers.pyx":101
4009  * DDATA M):
4010  * cdef SuperMatrix AS
4011  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4012  * AS.Dtype = superluWrappers._SLU_D
4013  * AS.Mtype = superluWrappers._SLU_GE
4014  */
4015  __pyx_v_AS.Stype = SLU_NR;
4016 
4017  /* "csmoothers.pyx":102
4018  * cdef SuperMatrix AS
4019  * AS.Stype = superluWrappers._SLU_NR
4020  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4021  * AS.Mtype = superluWrappers._SLU_GE
4022  * AS.nrow = sm.nr
4023  */
4024  __pyx_v_AS.Dtype = SLU_D;
4025 
4026  /* "csmoothers.pyx":103
4027  * AS.Stype = superluWrappers._SLU_NR
4028  * AS.Dtype = superluWrappers._SLU_D
4029  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4030  * AS.nrow = sm.nr
4031  * AS.ncol = sm.nc
4032  */
4033  __pyx_v_AS.Mtype = SLU_GE;
4034 
4035  /* "csmoothers.pyx":104
4036  * AS.Dtype = superluWrappers._SLU_D
4037  * AS.Mtype = superluWrappers._SLU_GE
4038  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4039  * AS.ncol = sm.nc
4040  * AS.Store = &sm.A
4041  */
4042  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
4043  __Pyx_GOTREF(__pyx_t_1);
4044  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4045  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4046  __pyx_v_AS.nrow = __pyx_t_2;
4047 
4048  /* "csmoothers.pyx":105
4049  * AS.Mtype = superluWrappers._SLU_GE
4050  * AS.nrow = sm.nr
4051  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4052  * AS.Store = &sm.A
4053  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4054  */
4055  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
4056  __Pyx_GOTREF(__pyx_t_1);
4057  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4058  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4059  __pyx_v_AS.ncol = __pyx_t_2;
4060 
4061  /* "csmoothers.pyx":106
4062  * AS.nrow = sm.nr
4063  * AS.ncol = sm.nc
4064  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4065  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4066  *
4067  */
4068  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4069 
4070  /* "csmoothers.pyx":107
4071  * AS.ncol = sm.nc
4072  * AS.Store = &sm.A
4073  * cjacobi_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4074  *
4075  * def jacobi_NR_solve(A, M, R, node_order, dX):
4076  */
4077  __pyx_t_3 = 0;
4078  __pyx_t_2 = -1;
4079  if (__pyx_t_3 < 0) {
4080  __pyx_t_3 += __pyx_v_M.shape[0];
4081  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4082  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4083  if (unlikely(__pyx_t_2 != -1)) {
4084  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4085  __PYX_ERR(0, 107, __pyx_L1_error)
4086  }
4087  jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4088 
4089  /* "csmoothers.pyx":96
4090  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
4091  *
4092  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4093  * double w,
4094  * double tol,
4095  */
4096 
4097  /* function exit code */
4098  goto __pyx_L0;
4099  __pyx_L1_error:;
4100  __Pyx_XDECREF(__pyx_t_1);
4101  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4102  __pyx_L0:;
4103  __Pyx_RefNannyFinishContext();
4104 }
4105 
4106 /* "csmoothers.pyx":109
4107  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4108  *
4109  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4110  * """
4111  *
4112  */
4113 
4114 /* Python wrapper */
4115 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4116 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4117 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {"jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4118 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4119  PyObject *__pyx_v_A = 0;
4120  PyObject *__pyx_v_M = 0;
4121  PyObject *__pyx_v_R = 0;
4122  PyObject *__pyx_v_node_order = 0;
4123  PyObject *__pyx_v_dX = 0;
4124  int __pyx_lineno = 0;
4125  const char *__pyx_filename = NULL;
4126  int __pyx_clineno = 0;
4127  PyObject *__pyx_r = 0;
4128  __Pyx_RefNannyDeclarations
4129  __Pyx_RefNannySetupContext("jacobi_NR_solve (wrapper)", 0);
4130  {
4131  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4132  PyObject* values[5] = {0,0,0,0,0};
4133  if (unlikely(__pyx_kwds)) {
4134  Py_ssize_t kw_args;
4135  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4136  switch (pos_args) {
4137  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4138  CYTHON_FALLTHROUGH;
4139  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4140  CYTHON_FALLTHROUGH;
4141  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4142  CYTHON_FALLTHROUGH;
4143  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4144  CYTHON_FALLTHROUGH;
4145  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4146  CYTHON_FALLTHROUGH;
4147  case 0: break;
4148  default: goto __pyx_L5_argtuple_error;
4149  }
4150  kw_args = PyDict_Size(__pyx_kwds);
4151  switch (pos_args) {
4152  case 0:
4153  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4154  else goto __pyx_L5_argtuple_error;
4155  CYTHON_FALLTHROUGH;
4156  case 1:
4157  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4158  else {
4159  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4160  }
4161  CYTHON_FALLTHROUGH;
4162  case 2:
4163  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4164  else {
4165  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4166  }
4167  CYTHON_FALLTHROUGH;
4168  case 3:
4169  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4170  else {
4171  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4172  }
4173  CYTHON_FALLTHROUGH;
4174  case 4:
4175  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4176  else {
4177  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4178  }
4179  }
4180  if (unlikely(kw_args > 0)) {
4181  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4182  }
4183  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4184  goto __pyx_L5_argtuple_error;
4185  } else {
4186  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4187  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4188  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4189  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4190  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4191  }
4192  __pyx_v_A = values[0];
4193  __pyx_v_M = values[1];
4194  __pyx_v_R = values[2];
4195  __pyx_v_node_order = values[3];
4196  __pyx_v_dX = values[4];
4197  }
4198  goto __pyx_L4_argument_unpacking_done;
4199  __pyx_L5_argtuple_error:;
4200  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4201  __pyx_L3_error:;
4202  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4203  __Pyx_RefNannyFinishContext();
4204  return NULL;
4205  __pyx_L4_argument_unpacking_done:;
4206  __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4207 
4208  /* function exit code */
4209  __Pyx_RefNannyFinishContext();
4210  return __pyx_r;
4211 }
4212 
4213 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4214  PyObject *__pyx_r = NULL;
4215  __Pyx_RefNannyDeclarations
4216  PyObject *__pyx_t_1 = NULL;
4217  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4218  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4219  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4220  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4221  int __pyx_lineno = 0;
4222  const char *__pyx_filename = NULL;
4223  int __pyx_clineno = 0;
4224  __Pyx_RefNannySetupContext("jacobi_NR_solve", 0);
4225 
4226  /* "csmoothers.pyx":120
4227  * dX : np.array double
4228  * """
4229  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
4230  *
4231  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4232  */
4233  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4234  __Pyx_GOTREF(__pyx_t_1);
4235  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4236  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4237  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4238  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4239  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4240  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4241  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4242  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4243  __pyx_t_2.memview = NULL;
4244  __pyx_t_2.data = NULL;
4245  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4246  __pyx_t_3.memview = NULL;
4247  __pyx_t_3.data = NULL;
4248  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4249  __pyx_t_4.memview = NULL;
4250  __pyx_t_4.data = NULL;
4251  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4252  __pyx_t_5.memview = NULL;
4253  __pyx_t_5.data = NULL;
4254 
4255  /* "csmoothers.pyx":109
4256  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4257  *
4258  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4259  * """
4260  *
4261  */
4262 
4263  /* function exit code */
4264  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4265  goto __pyx_L0;
4266  __pyx_L1_error:;
4267  __Pyx_XDECREF(__pyx_t_1);
4268  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4269  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4270  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4271  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4272  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4273  __pyx_r = NULL;
4274  __pyx_L0:;
4275  __Pyx_XGIVEREF(__pyx_r);
4276  __Pyx_RefNannyFinishContext();
4277  return __pyx_r;
4278 }
4279 
4280 /* "csmoothers.pyx":122
4281  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4282  *
4283  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4284  * DDATA M,
4285  * DDATA R,
4286  */
4287 
4288 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4289  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4290  __Pyx_RefNannyDeclarations
4291  PyObject *__pyx_t_1 = NULL;
4292  int __pyx_t_2;
4293  Py_ssize_t __pyx_t_3;
4294  Py_ssize_t __pyx_t_4;
4295  Py_ssize_t __pyx_t_5;
4296  Py_ssize_t __pyx_t_6;
4297  int __pyx_lineno = 0;
4298  const char *__pyx_filename = NULL;
4299  int __pyx_clineno = 0;
4300  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_solve", 0);
4301 
4302  /* "csmoothers.pyx":128
4303  * DDATA dX):
4304  * cdef SuperMatrix AS
4305  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4306  * AS.Dtype = superluWrappers._SLU_D
4307  * AS.Mtype = superluWrappers._SLU_GE
4308  */
4309  __pyx_v_AS.Stype = SLU_NR;
4310 
4311  /* "csmoothers.pyx":129
4312  * cdef SuperMatrix AS
4313  * AS.Stype = superluWrappers._SLU_NR
4314  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4315  * AS.Mtype = superluWrappers._SLU_GE
4316  * AS.nrow = sm.nr
4317  */
4318  __pyx_v_AS.Dtype = SLU_D;
4319 
4320  /* "csmoothers.pyx":130
4321  * AS.Stype = superluWrappers._SLU_NR
4322  * AS.Dtype = superluWrappers._SLU_D
4323  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4324  * AS.nrow = sm.nr
4325  * AS.ncol = sm.nc
4326  */
4327  __pyx_v_AS.Mtype = SLU_GE;
4328 
4329  /* "csmoothers.pyx":131
4330  * AS.Dtype = superluWrappers._SLU_D
4331  * AS.Mtype = superluWrappers._SLU_GE
4332  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4333  * AS.ncol = sm.nc
4334  * AS.Store = &sm.A
4335  */
4336  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4337  __Pyx_GOTREF(__pyx_t_1);
4338  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4339  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4340  __pyx_v_AS.nrow = __pyx_t_2;
4341 
4342  /* "csmoothers.pyx":132
4343  * AS.Mtype = superluWrappers._SLU_GE
4344  * AS.nrow = sm.nr
4345  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4346  * AS.Store = &sm.A
4347  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4348  */
4349  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4350  __Pyx_GOTREF(__pyx_t_1);
4351  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4352  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4353  __pyx_v_AS.ncol = __pyx_t_2;
4354 
4355  /* "csmoothers.pyx":133
4356  * AS.nrow = sm.nr
4357  * AS.ncol = sm.nc
4358  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4359  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4360  *
4361  */
4362  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4363 
4364  /* "csmoothers.pyx":134
4365  * AS.ncol = sm.nc
4366  * AS.Store = &sm.A
4367  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
4368  *
4369  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX):
4370  */
4371  __pyx_t_3 = 0;
4372  __pyx_t_2 = -1;
4373  if (__pyx_t_3 < 0) {
4374  __pyx_t_3 += __pyx_v_M.shape[0];
4375  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4376  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4377  if (unlikely(__pyx_t_2 != -1)) {
4378  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4379  __PYX_ERR(0, 134, __pyx_L1_error)
4380  }
4381  __pyx_t_4 = 0;
4382  __pyx_t_2 = -1;
4383  if (__pyx_t_4 < 0) {
4384  __pyx_t_4 += __pyx_v_R.shape[0];
4385  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4386  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4387  if (unlikely(__pyx_t_2 != -1)) {
4388  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4389  __PYX_ERR(0, 134, __pyx_L1_error)
4390  }
4391  __pyx_t_5 = 0;
4392  __pyx_t_2 = -1;
4393  if (__pyx_t_5 < 0) {
4394  __pyx_t_5 += __pyx_v_node_order.shape[0];
4395  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4396  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4397  if (unlikely(__pyx_t_2 != -1)) {
4398  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4399  __PYX_ERR(0, 134, __pyx_L1_error)
4400  }
4401  __pyx_t_6 = 0;
4402  __pyx_t_2 = -1;
4403  if (__pyx_t_6 < 0) {
4404  __pyx_t_6 += __pyx_v_dX.shape[0];
4405  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4406  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4407  if (unlikely(__pyx_t_2 != -1)) {
4408  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4409  __PYX_ERR(0, 134, __pyx_L1_error)
4410  }
4411  jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4412 
4413  /* "csmoothers.pyx":122
4414  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4415  *
4416  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4417  * DDATA M,
4418  * DDATA R,
4419  */
4420 
4421  /* function exit code */
4422  goto __pyx_L0;
4423  __pyx_L1_error:;
4424  __Pyx_XDECREF(__pyx_t_1);
4425  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4426  __pyx_L0:;
4427  __Pyx_RefNannyFinishContext();
4428 }
4429 
4430 /* "csmoothers.pyx":136
4431  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4432  *
4433  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4434  * """
4435  *
4436  */
4437 
4438 /* Python wrapper */
4439 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4440 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4441 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {"nl_jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4442 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4443  PyObject *__pyx_v_A = 0;
4444  PyObject *__pyx_v_R = 0;
4445  PyObject *__pyx_v_node_order = 0;
4446  PyObject *__pyx_v_w = 0;
4447  PyObject *__pyx_v_tol = 0;
4448  PyObject *__pyx_v_dX = 0;
4449  int __pyx_lineno = 0;
4450  const char *__pyx_filename = NULL;
4451  int __pyx_clineno = 0;
4452  PyObject *__pyx_r = 0;
4453  __Pyx_RefNannyDeclarations
4454  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve (wrapper)", 0);
4455  {
4456  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4457  PyObject* values[6] = {0,0,0,0,0,0};
4458  if (unlikely(__pyx_kwds)) {
4459  Py_ssize_t kw_args;
4460  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4461  switch (pos_args) {
4462  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4463  CYTHON_FALLTHROUGH;
4464  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4465  CYTHON_FALLTHROUGH;
4466  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4467  CYTHON_FALLTHROUGH;
4468  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4469  CYTHON_FALLTHROUGH;
4470  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4471  CYTHON_FALLTHROUGH;
4472  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4473  CYTHON_FALLTHROUGH;
4474  case 0: break;
4475  default: goto __pyx_L5_argtuple_error;
4476  }
4477  kw_args = PyDict_Size(__pyx_kwds);
4478  switch (pos_args) {
4479  case 0:
4480  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4481  else goto __pyx_L5_argtuple_error;
4482  CYTHON_FALLTHROUGH;
4483  case 1:
4484  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4485  else {
4486  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4487  }
4488  CYTHON_FALLTHROUGH;
4489  case 2:
4490  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4491  else {
4492  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4493  }
4494  CYTHON_FALLTHROUGH;
4495  case 3:
4496  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4497  else {
4498  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4499  }
4500  CYTHON_FALLTHROUGH;
4501  case 4:
4502  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4503  else {
4504  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4505  }
4506  CYTHON_FALLTHROUGH;
4507  case 5:
4508  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4509  else {
4510  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4511  }
4512  }
4513  if (unlikely(kw_args > 0)) {
4514  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4515  }
4516  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4517  goto __pyx_L5_argtuple_error;
4518  } else {
4519  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4520  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4521  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4522  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4523  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4524  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4525  }
4526  __pyx_v_A = values[0];
4527  __pyx_v_R = values[1];
4528  __pyx_v_node_order = values[2];
4529  __pyx_v_w = values[3];
4530  __pyx_v_tol = values[4];
4531  __pyx_v_dX = values[5];
4532  }
4533  goto __pyx_L4_argument_unpacking_done;
4534  __pyx_L5_argtuple_error:;
4535  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4536  __pyx_L3_error:;
4537  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4538  __Pyx_RefNannyFinishContext();
4539  return NULL;
4540  __pyx_L4_argument_unpacking_done:;
4541  __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4542 
4543  /* function exit code */
4544  __Pyx_RefNannyFinishContext();
4545  return __pyx_r;
4546 }
4547 
4548 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4549  PyObject *__pyx_r = NULL;
4550  __Pyx_RefNannyDeclarations
4551  PyObject *__pyx_t_1 = NULL;
4552  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4553  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4554  double __pyx_t_4;
4555  double __pyx_t_5;
4556  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4557  int __pyx_lineno = 0;
4558  const char *__pyx_filename = NULL;
4559  int __pyx_clineno = 0;
4560  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve", 0);
4561 
4562  /* "csmoothers.pyx":148
4563  * dX : np.array double
4564  * """
4565  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX) # <<<<<<<<<<<<<<
4566  *
4567  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4568  */
4569  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4570  __Pyx_GOTREF(__pyx_t_1);
4571  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4572  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4573  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4574  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4575  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4576  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4577  __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4578  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4579  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4580  __pyx_t_2.memview = NULL;
4581  __pyx_t_2.data = NULL;
4582  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4583  __pyx_t_3.memview = NULL;
4584  __pyx_t_3.data = NULL;
4585  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4586  __pyx_t_6.memview = NULL;
4587  __pyx_t_6.data = NULL;
4588 
4589  /* "csmoothers.pyx":136
4590  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4591  *
4592  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4593  * """
4594  *
4595  */
4596 
4597  /* function exit code */
4598  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4599  goto __pyx_L0;
4600  __pyx_L1_error:;
4601  __Pyx_XDECREF(__pyx_t_1);
4602  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4603  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4604  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4605  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4606  __pyx_r = NULL;
4607  __pyx_L0:;
4608  __Pyx_XGIVEREF(__pyx_r);
4609  __Pyx_RefNannyFinishContext();
4610  return __pyx_r;
4611 }
4612 
4613 /* "csmoothers.pyx":150
4614  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4615  *
4616  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4617  * DDATA R,
4618  * IDATA node_order,
4619  */
4620 
4621 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4622  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4623  __Pyx_RefNannyDeclarations
4624  PyObject *__pyx_t_1 = NULL;
4625  int __pyx_t_2;
4626  Py_ssize_t __pyx_t_3;
4627  Py_ssize_t __pyx_t_4;
4628  Py_ssize_t __pyx_t_5;
4629  int __pyx_lineno = 0;
4630  const char *__pyx_filename = NULL;
4631  int __pyx_clineno = 0;
4632  __Pyx_RefNannySetupContext("smootherWrappersnl_jacobi_NR_solve", 0);
4633 
4634  /* "csmoothers.pyx":157
4635  * DDATA dX):
4636  * cdef SuperMatrix AS
4637  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4638  * AS.Dtype = superluWrappers._SLU_D
4639  * AS.Mtype = superluWrappers._SLU_GE
4640  */
4641  __pyx_v_AS.Stype = SLU_NR;
4642 
4643  /* "csmoothers.pyx":158
4644  * cdef SuperMatrix AS
4645  * AS.Stype = superluWrappers._SLU_NR
4646  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4647  * AS.Mtype = superluWrappers._SLU_GE
4648  * AS.nrow = sm.nr
4649  */
4650  __pyx_v_AS.Dtype = SLU_D;
4651 
4652  /* "csmoothers.pyx":159
4653  * AS.Stype = superluWrappers._SLU_NR
4654  * AS.Dtype = superluWrappers._SLU_D
4655  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4656  * AS.nrow = sm.nr
4657  * AS.ncol = sm.nc
4658  */
4659  __pyx_v_AS.Mtype = SLU_GE;
4660 
4661  /* "csmoothers.pyx":160
4662  * AS.Dtype = superluWrappers._SLU_D
4663  * AS.Mtype = superluWrappers._SLU_GE
4664  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4665  * AS.ncol = sm.nc
4666  * AS.Store = &sm.A
4667  */
4668  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4669  __Pyx_GOTREF(__pyx_t_1);
4670  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4671  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4672  __pyx_v_AS.nrow = __pyx_t_2;
4673 
4674  /* "csmoothers.pyx":161
4675  * AS.Mtype = superluWrappers._SLU_GE
4676  * AS.nrow = sm.nr
4677  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4678  * AS.Store = &sm.A
4679  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4680  */
4681  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4682  __Pyx_GOTREF(__pyx_t_1);
4683  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4684  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4685  __pyx_v_AS.ncol = __pyx_t_2;
4686 
4687  /* "csmoothers.pyx":162
4688  * AS.nrow = sm.nr
4689  * AS.ncol = sm.nc
4690  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4691  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4692  *
4693  */
4694  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4695 
4696  /* "csmoothers.pyx":163
4697  * AS.ncol = sm.nc
4698  * AS.Store = &sm.A
4699  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
4700  *
4701  * def gauss_seidel_NR_preare(A, w, tol, M):
4702  */
4703  __pyx_t_3 = 0;
4704  __pyx_t_2 = -1;
4705  if (__pyx_t_3 < 0) {
4706  __pyx_t_3 += __pyx_v_R.shape[0];
4707  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4708  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4709  if (unlikely(__pyx_t_2 != -1)) {
4710  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4711  __PYX_ERR(0, 163, __pyx_L1_error)
4712  }
4713  __pyx_t_4 = 0;
4714  __pyx_t_2 = -1;
4715  if (__pyx_t_4 < 0) {
4716  __pyx_t_4 += __pyx_v_node_order.shape[0];
4717  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4718  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4719  if (unlikely(__pyx_t_2 != -1)) {
4720  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4721  __PYX_ERR(0, 163, __pyx_L1_error)
4722  }
4723  __pyx_t_5 = 0;
4724  __pyx_t_2 = -1;
4725  if (__pyx_t_5 < 0) {
4726  __pyx_t_5 += __pyx_v_dX.shape[0];
4727  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4728  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4729  if (unlikely(__pyx_t_2 != -1)) {
4730  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4731  __PYX_ERR(0, 163, __pyx_L1_error)
4732  }
4733  nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4734 
4735  /* "csmoothers.pyx":150
4736  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4737  *
4738  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4739  * DDATA R,
4740  * IDATA node_order,
4741  */
4742 
4743  /* function exit code */
4744  goto __pyx_L0;
4745  __pyx_L1_error:;
4746  __Pyx_XDECREF(__pyx_t_1);
4747  __Pyx_WriteUnraisable("csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4748  __pyx_L0:;
4749  __Pyx_RefNannyFinishContext();
4750 }
4751 
4752 /* "csmoothers.pyx":165
4753  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4754  *
4755  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4756  * """
4757  *
4758  */
4759 
4760 /* Python wrapper */
4761 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4762 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] = "\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4763 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {"gauss_seidel_NR_preare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4764 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4765  PyObject *__pyx_v_A = 0;
4766  PyObject *__pyx_v_w = 0;
4767  PyObject *__pyx_v_tol = 0;
4768  PyObject *__pyx_v_M = 0;
4769  int __pyx_lineno = 0;
4770  const char *__pyx_filename = NULL;
4771  int __pyx_clineno = 0;
4772  PyObject *__pyx_r = 0;
4773  __Pyx_RefNannyDeclarations
4774  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare (wrapper)", 0);
4775  {
4776  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4777  PyObject* values[4] = {0,0,0,0};
4778  if (unlikely(__pyx_kwds)) {
4779  Py_ssize_t kw_args;
4780  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4781  switch (pos_args) {
4782  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4783  CYTHON_FALLTHROUGH;
4784  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4785  CYTHON_FALLTHROUGH;
4786  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4787  CYTHON_FALLTHROUGH;
4788  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4789  CYTHON_FALLTHROUGH;
4790  case 0: break;
4791  default: goto __pyx_L5_argtuple_error;
4792  }
4793  kw_args = PyDict_Size(__pyx_kwds);
4794  switch (pos_args) {
4795  case 0:
4796  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4797  else goto __pyx_L5_argtuple_error;
4798  CYTHON_FALLTHROUGH;
4799  case 1:
4800  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4801  else {
4802  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4803  }
4804  CYTHON_FALLTHROUGH;
4805  case 2:
4806  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4807  else {
4808  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4809  }
4810  CYTHON_FALLTHROUGH;
4811  case 3:
4812  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4813  else {
4814  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4815  }
4816  }
4817  if (unlikely(kw_args > 0)) {
4818  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4819  }
4820  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4821  goto __pyx_L5_argtuple_error;
4822  } else {
4823  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4824  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4825  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4826  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4827  }
4828  __pyx_v_A = values[0];
4829  __pyx_v_w = values[1];
4830  __pyx_v_tol = values[2];
4831  __pyx_v_M = values[3];
4832  }
4833  goto __pyx_L4_argument_unpacking_done;
4834  __pyx_L5_argtuple_error:;
4835  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4836  __pyx_L3_error:;
4837  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4838  __Pyx_RefNannyFinishContext();
4839  return NULL;
4840  __pyx_L4_argument_unpacking_done:;
4841  __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4842 
4843  /* function exit code */
4844  __Pyx_RefNannyFinishContext();
4845  return __pyx_r;
4846 }
4847 
4848 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4849  PyObject *__pyx_r = NULL;
4850  __Pyx_RefNannyDeclarations
4851  PyObject *__pyx_t_1 = NULL;
4852  double __pyx_t_2;
4853  double __pyx_t_3;
4854  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4855  int __pyx_lineno = 0;
4856  const char *__pyx_filename = NULL;
4857  int __pyx_clineno = 0;
4858  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare", 0);
4859 
4860  /* "csmoothers.pyx":175
4861  * M :
4862  * """
4863  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4864  *
4865  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm,
4866  */
4867  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4868  __Pyx_GOTREF(__pyx_t_1);
4869  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4870  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4871  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4872  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4873  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4874  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4875  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4876  __pyx_t_4.memview = NULL;
4877  __pyx_t_4.data = NULL;
4878 
4879  /* "csmoothers.pyx":165
4880  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4881  *
4882  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4883  * """
4884  *
4885  */
4886 
4887  /* function exit code */
4888  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4889  goto __pyx_L0;
4890  __pyx_L1_error:;
4891  __Pyx_XDECREF(__pyx_t_1);
4892  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4893  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4894  __pyx_r = NULL;
4895  __pyx_L0:;
4896  __Pyx_XGIVEREF(__pyx_r);
4897  __Pyx_RefNannyFinishContext();
4898  return __pyx_r;
4899 }
4900 
4901 /* "csmoothers.pyx":177
4902  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4903  *
4904  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4905  * double w,
4906  * double tol,
4907  */
4908 
4909 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4910  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4911  __Pyx_RefNannyDeclarations
4912  PyObject *__pyx_t_1 = NULL;
4913  int __pyx_t_2;
4914  Py_ssize_t __pyx_t_3;
4915  int __pyx_lineno = 0;
4916  const char *__pyx_filename = NULL;
4917  int __pyx_clineno = 0;
4918  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_prepare", 0);
4919 
4920  /* "csmoothers.pyx":182
4921  * DDATA M):
4922  * cdef SuperMatrix AS
4923  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4924  * AS.Dtype = superluWrappers._SLU_D
4925  * AS.Mtype = superluWrappers._SLU_GE
4926  */
4927  __pyx_v_AS.Stype = SLU_NR;
4928 
4929  /* "csmoothers.pyx":183
4930  * cdef SuperMatrix AS
4931  * AS.Stype = superluWrappers._SLU_NR
4932  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4933  * AS.Mtype = superluWrappers._SLU_GE
4934  * AS.nrow = sm.nr
4935  */
4936  __pyx_v_AS.Dtype = SLU_D;
4937 
4938  /* "csmoothers.pyx":184
4939  * AS.Stype = superluWrappers._SLU_NR
4940  * AS.Dtype = superluWrappers._SLU_D
4941  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4942  * AS.nrow = sm.nr
4943  * AS.ncol = sm.nc
4944  */
4945  __pyx_v_AS.Mtype = SLU_GE;
4946 
4947  /* "csmoothers.pyx":185
4948  * AS.Dtype = superluWrappers._SLU_D
4949  * AS.Mtype = superluWrappers._SLU_GE
4950  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4951  * AS.ncol = sm.nc
4952  * AS.Store = &sm.A
4953  */
4954  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
4955  __Pyx_GOTREF(__pyx_t_1);
4956  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
4957  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4958  __pyx_v_AS.nrow = __pyx_t_2;
4959 
4960  /* "csmoothers.pyx":186
4961  * AS.Mtype = superluWrappers._SLU_GE
4962  * AS.nrow = sm.nr
4963  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4964  * AS.Store = &sm.A
4965  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4966  */
4967  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
4968  __Pyx_GOTREF(__pyx_t_1);
4969  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
4970  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4971  __pyx_v_AS.ncol = __pyx_t_2;
4972 
4973  /* "csmoothers.pyx":187
4974  * AS.nrow = sm.nr
4975  * AS.ncol = sm.nc
4976  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4977  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
4978  *
4979  */
4980  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4981 
4982  /* "csmoothers.pyx":188
4983  * AS.ncol = sm.nc
4984  * AS.Store = &sm.A
4985  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4986  *
4987  * def gauss_seidel_NR_solve(A, M, R, node_order, dX):
4988  */
4989  __pyx_t_3 = 0;
4990  __pyx_t_2 = -1;
4991  if (__pyx_t_3 < 0) {
4992  __pyx_t_3 += __pyx_v_M.shape[0];
4993  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4994  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4995  if (unlikely(__pyx_t_2 != -1)) {
4996  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4997  __PYX_ERR(0, 188, __pyx_L1_error)
4998  }
4999  gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
5000 
5001  /* "csmoothers.pyx":177
5002  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
5003  *
5004  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5005  * double w,
5006  * double tol,
5007  */
5008 
5009  /* function exit code */
5010  goto __pyx_L0;
5011  __pyx_L1_error:;
5012  __Pyx_XDECREF(__pyx_t_1);
5013  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5014  __pyx_L0:;
5015  __Pyx_RefNannyFinishContext();
5016 }
5017 
5018 /* "csmoothers.pyx":190
5019  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5020  *
5021  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5022  * """
5023  *
5024  */
5025 
5026 /* Python wrapper */
5027 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5028 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
5029 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {"gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
5030 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5031  PyObject *__pyx_v_A = 0;
5032  PyObject *__pyx_v_M = 0;
5033  PyObject *__pyx_v_R = 0;
5034  PyObject *__pyx_v_node_order = 0;
5035  PyObject *__pyx_v_dX = 0;
5036  int __pyx_lineno = 0;
5037  const char *__pyx_filename = NULL;
5038  int __pyx_clineno = 0;
5039  PyObject *__pyx_r = 0;
5040  __Pyx_RefNannyDeclarations
5041  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve (wrapper)", 0);
5042  {
5043  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
5044  PyObject* values[5] = {0,0,0,0,0};
5045  if (unlikely(__pyx_kwds)) {
5046  Py_ssize_t kw_args;
5047  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5048  switch (pos_args) {
5049  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5050  CYTHON_FALLTHROUGH;
5051  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5052  CYTHON_FALLTHROUGH;
5053  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5054  CYTHON_FALLTHROUGH;
5055  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5056  CYTHON_FALLTHROUGH;
5057  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5058  CYTHON_FALLTHROUGH;
5059  case 0: break;
5060  default: goto __pyx_L5_argtuple_error;
5061  }
5062  kw_args = PyDict_Size(__pyx_kwds);
5063  switch (pos_args) {
5064  case 0:
5065  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5066  else goto __pyx_L5_argtuple_error;
5067  CYTHON_FALLTHROUGH;
5068  case 1:
5069  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
5070  else {
5071  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
5072  }
5073  CYTHON_FALLTHROUGH;
5074  case 2:
5075  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5076  else {
5077  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
5078  }
5079  CYTHON_FALLTHROUGH;
5080  case 3:
5081  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5082  else {
5083  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5084  }
5085  CYTHON_FALLTHROUGH;
5086  case 4:
5087  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5088  else {
5089  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5090  }
5091  }
5092  if (unlikely(kw_args > 0)) {
5093  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5094  }
5095  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5096  goto __pyx_L5_argtuple_error;
5097  } else {
5098  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5099  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5100  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5101  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5102  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5103  }
5104  __pyx_v_A = values[0];
5105  __pyx_v_M = values[1];
5106  __pyx_v_R = values[2];
5107  __pyx_v_node_order = values[3];
5108  __pyx_v_dX = values[4];
5109  }
5110  goto __pyx_L4_argument_unpacking_done;
5111  __pyx_L5_argtuple_error:;
5112  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5113  __pyx_L3_error:;
5114  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5115  __Pyx_RefNannyFinishContext();
5116  return NULL;
5117  __pyx_L4_argument_unpacking_done:;
5118  __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5119 
5120  /* function exit code */
5121  __Pyx_RefNannyFinishContext();
5122  return __pyx_r;
5123 }
5124 
5125 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5126  PyObject *__pyx_r = NULL;
5127  __Pyx_RefNannyDeclarations
5128  PyObject *__pyx_t_1 = NULL;
5129  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5130  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5131  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5132  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5133  int __pyx_lineno = 0;
5134  const char *__pyx_filename = NULL;
5135  int __pyx_clineno = 0;
5136  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve", 0);
5137 
5138  /* "csmoothers.pyx":201
5139  * dX : np.array double
5140  * """
5141  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
5142  *
5143  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5144  */
5145  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5146  __Pyx_GOTREF(__pyx_t_1);
5147  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5148  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5149  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5150  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5151  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5152  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5153  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5154  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5155  __pyx_t_2.memview = NULL;
5156  __pyx_t_2.data = NULL;
5157  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5158  __pyx_t_3.memview = NULL;
5159  __pyx_t_3.data = NULL;
5160  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5161  __pyx_t_4.memview = NULL;
5162  __pyx_t_4.data = NULL;
5163  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5164  __pyx_t_5.memview = NULL;
5165  __pyx_t_5.data = NULL;
5166 
5167  /* "csmoothers.pyx":190
5168  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5169  *
5170  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5171  * """
5172  *
5173  */
5174 
5175  /* function exit code */
5176  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5177  goto __pyx_L0;
5178  __pyx_L1_error:;
5179  __Pyx_XDECREF(__pyx_t_1);
5180  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5181  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5182  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5183  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5184  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5185  __pyx_r = NULL;
5186  __pyx_L0:;
5187  __Pyx_XGIVEREF(__pyx_r);
5188  __Pyx_RefNannyFinishContext();
5189  return __pyx_r;
5190 }
5191 
5192 /* "csmoothers.pyx":203
5193  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5194  *
5195  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5196  * DDATA M,
5197  * DDATA R,
5198  */
5199 
5200 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5201  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5202  __Pyx_RefNannyDeclarations
5203  PyObject *__pyx_t_1 = NULL;
5204  int __pyx_t_2;
5205  Py_ssize_t __pyx_t_3;
5206  Py_ssize_t __pyx_t_4;
5207  Py_ssize_t __pyx_t_5;
5208  Py_ssize_t __pyx_t_6;
5209  int __pyx_lineno = 0;
5210  const char *__pyx_filename = NULL;
5211  int __pyx_clineno = 0;
5212  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_solve", 0);
5213 
5214  /* "csmoothers.pyx":209
5215  * DDATA dX):
5216  * cdef SuperMatrix AS
5217  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5218  * AS.Dtype = superluWrappers._SLU_D
5219  * AS.Mtype = superluWrappers._SLU_GE
5220  */
5221  __pyx_v_AS.Stype = SLU_NR;
5222 
5223  /* "csmoothers.pyx":210
5224  * cdef SuperMatrix AS
5225  * AS.Stype = superluWrappers._SLU_NR
5226  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5227  * AS.Mtype = superluWrappers._SLU_GE
5228  * AS.nrow = sm.nr
5229  */
5230  __pyx_v_AS.Dtype = SLU_D;
5231 
5232  /* "csmoothers.pyx":211
5233  * AS.Stype = superluWrappers._SLU_NR
5234  * AS.Dtype = superluWrappers._SLU_D
5235  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5236  * AS.nrow = sm.nr
5237  * AS.ncol = sm.nc
5238  */
5239  __pyx_v_AS.Mtype = SLU_GE;
5240 
5241  /* "csmoothers.pyx":212
5242  * AS.Dtype = superluWrappers._SLU_D
5243  * AS.Mtype = superluWrappers._SLU_GE
5244  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5245  * AS.ncol = sm.nc
5246  * AS.Store = &sm.A
5247  */
5248  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5249  __Pyx_GOTREF(__pyx_t_1);
5250  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5251  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5252  __pyx_v_AS.nrow = __pyx_t_2;
5253 
5254  /* "csmoothers.pyx":213
5255  * AS.Mtype = superluWrappers._SLU_GE
5256  * AS.nrow = sm.nr
5257  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5258  * AS.Store = &sm.A
5259  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5260  */
5261  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5262  __Pyx_GOTREF(__pyx_t_1);
5263  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5264  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5265  __pyx_v_AS.ncol = __pyx_t_2;
5266 
5267  /* "csmoothers.pyx":214
5268  * AS.nrow = sm.nr
5269  * AS.ncol = sm.nc
5270  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5271  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5272  *
5273  */
5274  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5275 
5276  /* "csmoothers.pyx":215
5277  * AS.ncol = sm.nc
5278  * AS.Store = &sm.A
5279  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
5280  *
5281  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX):
5282  */
5283  __pyx_t_3 = 0;
5284  __pyx_t_2 = -1;
5285  if (__pyx_t_3 < 0) {
5286  __pyx_t_3 += __pyx_v_M.shape[0];
5287  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5288  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5289  if (unlikely(__pyx_t_2 != -1)) {
5290  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5291  __PYX_ERR(0, 215, __pyx_L1_error)
5292  }
5293  __pyx_t_4 = 0;
5294  __pyx_t_2 = -1;
5295  if (__pyx_t_4 < 0) {
5296  __pyx_t_4 += __pyx_v_R.shape[0];
5297  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5298  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5299  if (unlikely(__pyx_t_2 != -1)) {
5300  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5301  __PYX_ERR(0, 215, __pyx_L1_error)
5302  }
5303  __pyx_t_5 = 0;
5304  __pyx_t_2 = -1;
5305  if (__pyx_t_5 < 0) {
5306  __pyx_t_5 += __pyx_v_node_order.shape[0];
5307  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5308  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5309  if (unlikely(__pyx_t_2 != -1)) {
5310  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5311  __PYX_ERR(0, 215, __pyx_L1_error)
5312  }
5313  __pyx_t_6 = 0;
5314  __pyx_t_2 = -1;
5315  if (__pyx_t_6 < 0) {
5316  __pyx_t_6 += __pyx_v_dX.shape[0];
5317  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5318  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5319  if (unlikely(__pyx_t_2 != -1)) {
5320  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5321  __PYX_ERR(0, 215, __pyx_L1_error)
5322  }
5323  gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5324 
5325  /* "csmoothers.pyx":203
5326  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5327  *
5328  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5329  * DDATA M,
5330  * DDATA R,
5331  */
5332 
5333  /* function exit code */
5334  goto __pyx_L0;
5335  __pyx_L1_error:;
5336  __Pyx_XDECREF(__pyx_t_1);
5337  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5338  __pyx_L0:;
5339  __Pyx_RefNannyFinishContext();
5340 }
5341 
5342 /* "csmoothers.pyx":217
5343  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5344  *
5345  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5346  * """
5347  *
5348  */
5349 
5350 /* Python wrapper */
5351 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5352 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5353 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {"nl_gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5354 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5355  PyObject *__pyx_v_A = 0;
5356  PyObject *__pyx_v_R = 0;
5357  PyObject *__pyx_v_node_order = 0;
5358  PyObject *__pyx_v_w = 0;
5359  PyObject *__pyx_v_tol = 0;
5360  PyObject *__pyx_v_dX = 0;
5361  int __pyx_lineno = 0;
5362  const char *__pyx_filename = NULL;
5363  int __pyx_clineno = 0;
5364  PyObject *__pyx_r = 0;
5365  __Pyx_RefNannyDeclarations
5366  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve (wrapper)", 0);
5367  {
5368  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5369  PyObject* values[6] = {0,0,0,0,0,0};
5370  if (unlikely(__pyx_kwds)) {
5371  Py_ssize_t kw_args;
5372  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5373  switch (pos_args) {
5374  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5375  CYTHON_FALLTHROUGH;
5376  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5377  CYTHON_FALLTHROUGH;
5378  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5379  CYTHON_FALLTHROUGH;
5380  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5381  CYTHON_FALLTHROUGH;
5382  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5383  CYTHON_FALLTHROUGH;
5384  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5385  CYTHON_FALLTHROUGH;
5386  case 0: break;
5387  default: goto __pyx_L5_argtuple_error;
5388  }
5389  kw_args = PyDict_Size(__pyx_kwds);
5390  switch (pos_args) {
5391  case 0:
5392  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5393  else goto __pyx_L5_argtuple_error;
5394  CYTHON_FALLTHROUGH;
5395  case 1:
5396  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5397  else {
5398  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5399  }
5400  CYTHON_FALLTHROUGH;
5401  case 2:
5402  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5403  else {
5404  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5405  }
5406  CYTHON_FALLTHROUGH;
5407  case 3:
5408  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5409  else {
5410  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5411  }
5412  CYTHON_FALLTHROUGH;
5413  case 4:
5414  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5415  else {
5416  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5417  }
5418  CYTHON_FALLTHROUGH;
5419  case 5:
5420  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5421  else {
5422  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5423  }
5424  }
5425  if (unlikely(kw_args > 0)) {
5426  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5427  }
5428  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5429  goto __pyx_L5_argtuple_error;
5430  } else {
5431  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5432  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5433  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5434  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5435  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5436  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5437  }
5438  __pyx_v_A = values[0];
5439  __pyx_v_R = values[1];
5440  __pyx_v_node_order = values[2];
5441  __pyx_v_w = values[3];
5442  __pyx_v_tol = values[4];
5443  __pyx_v_dX = values[5];
5444  }
5445  goto __pyx_L4_argument_unpacking_done;
5446  __pyx_L5_argtuple_error:;
5447  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5448  __pyx_L3_error:;
5449  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5450  __Pyx_RefNannyFinishContext();
5451  return NULL;
5452  __pyx_L4_argument_unpacking_done:;
5453  __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5454 
5455  /* function exit code */
5456  __Pyx_RefNannyFinishContext();
5457  return __pyx_r;
5458 }
5459 
5460 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5461  PyObject *__pyx_r = NULL;
5462  __Pyx_RefNannyDeclarations
5463  PyObject *__pyx_t_1 = NULL;
5464  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5465  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5466  double __pyx_t_4;
5467  double __pyx_t_5;
5468  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5469  PyObject *__pyx_t_7 = NULL;
5470  int __pyx_lineno = 0;
5471  const char *__pyx_filename = NULL;
5472  int __pyx_clineno = 0;
5473  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve", 0);
5474 
5475  /* "csmoothers.pyx":229
5476  * dX : np.array double
5477  * """
5478  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5479  * R,
5480  * node_order,
5481  */
5482  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5483  __Pyx_GOTREF(__pyx_t_1);
5484  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5485 
5486  /* "csmoothers.pyx":230
5487  * """
5488  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5489  * R, # <<<<<<<<<<<<<<
5490  * node_order,
5491  * w,
5492  */
5493  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5494 
5495  /* "csmoothers.pyx":231
5496  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5497  * R,
5498  * node_order, # <<<<<<<<<<<<<<
5499  * w,
5500  * tol,
5501  */
5502  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5503 
5504  /* "csmoothers.pyx":232
5505  * R,
5506  * node_order,
5507  * w, # <<<<<<<<<<<<<<
5508  * tol,
5509  * dX)
5510  */
5511  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5512 
5513  /* "csmoothers.pyx":233
5514  * node_order,
5515  * w,
5516  * tol, # <<<<<<<<<<<<<<
5517  * dX)
5518  *
5519  */
5520  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5521 
5522  /* "csmoothers.pyx":234
5523  * w,
5524  * tol,
5525  * dX) # <<<<<<<<<<<<<<
5526  *
5527  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5528  */
5529  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5530 
5531  /* "csmoothers.pyx":229
5532  * dX : np.array double
5533  * """
5534  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5535  * R,
5536  * node_order,
5537  */
5538  __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5539  __Pyx_GOTREF(__pyx_t_7);
5540  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5541  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5542  __pyx_t_2.memview = NULL;
5543  __pyx_t_2.data = NULL;
5544  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5545  __pyx_t_3.memview = NULL;
5546  __pyx_t_3.data = NULL;
5547  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5548  __pyx_t_6.memview = NULL;
5549  __pyx_t_6.data = NULL;
5550  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5551 
5552  /* "csmoothers.pyx":217
5553  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5554  *
5555  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5556  * """
5557  *
5558  */
5559 
5560  /* function exit code */
5561  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5562  goto __pyx_L0;
5563  __pyx_L1_error:;
5564  __Pyx_XDECREF(__pyx_t_1);
5565  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5566  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5567  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5568  __Pyx_XDECREF(__pyx_t_7);
5569  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5570  __pyx_r = NULL;
5571  __pyx_L0:;
5572  __Pyx_XGIVEREF(__pyx_r);
5573  __Pyx_RefNannyFinishContext();
5574  return __pyx_r;
5575 }
5576 
5577 /* "csmoothers.pyx":236
5578  * dX)
5579  *
5580  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5581  * DDATA R,
5582  * IDATA node_order,
5583  */
5584 
5585 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5586  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5587  PyObject *__pyx_r = NULL;
5588  __Pyx_RefNannyDeclarations
5589  PyObject *__pyx_t_1 = NULL;
5590  int __pyx_t_2;
5591  Py_ssize_t __pyx_t_3;
5592  Py_ssize_t __pyx_t_4;
5593  Py_ssize_t __pyx_t_5;
5594  int __pyx_lineno = 0;
5595  const char *__pyx_filename = NULL;
5596  int __pyx_clineno = 0;
5597  __Pyx_RefNannySetupContext("smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5598 
5599  /* "csmoothers.pyx":243
5600  * DDATA dX):
5601  * cdef SuperMatrix AS
5602  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5603  * AS.Dtype = superluWrappers._SLU_D
5604  * AS.Mtype = superluWrappers._SLU_GE
5605  */
5606  __pyx_v_AS.Stype = SLU_NR;
5607 
5608  /* "csmoothers.pyx":244
5609  * cdef SuperMatrix AS
5610  * AS.Stype = superluWrappers._SLU_NR
5611  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5612  * AS.Mtype = superluWrappers._SLU_GE
5613  * AS.nrow = sm.nr
5614  */
5615  __pyx_v_AS.Dtype = SLU_D;
5616 
5617  /* "csmoothers.pyx":245
5618  * AS.Stype = superluWrappers._SLU_NR
5619  * AS.Dtype = superluWrappers._SLU_D
5620  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5621  * AS.nrow = sm.nr
5622  * AS.ncol = sm.nc
5623  */
5624  __pyx_v_AS.Mtype = SLU_GE;
5625 
5626  /* "csmoothers.pyx":246
5627  * AS.Dtype = superluWrappers._SLU_D
5628  * AS.Mtype = superluWrappers._SLU_GE
5629  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5630  * AS.ncol = sm.nc
5631  * AS.Store = &sm.A
5632  */
5633  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5634  __Pyx_GOTREF(__pyx_t_1);
5635  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5636  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5637  __pyx_v_AS.nrow = __pyx_t_2;
5638 
5639  /* "csmoothers.pyx":247
5640  * AS.Mtype = superluWrappers._SLU_GE
5641  * AS.nrow = sm.nr
5642  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5643  * AS.Store = &sm.A
5644  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5645  */
5646  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5647  __Pyx_GOTREF(__pyx_t_1);
5648  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5649  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5650  __pyx_v_AS.ncol = __pyx_t_2;
5651 
5652  /* "csmoothers.pyx":248
5653  * AS.nrow = sm.nr
5654  * AS.ncol = sm.nc
5655  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5656  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5657  *
5658  */
5659  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5660 
5661  /* "csmoothers.pyx":249
5662  * AS.ncol = sm.nc
5663  * AS.Store = &sm.A
5664  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
5665  *
5666  * def asm_NR_prepare(A, asmFactor):
5667  */
5668  __pyx_t_3 = 0;
5669  __pyx_t_2 = -1;
5670  if (__pyx_t_3 < 0) {
5671  __pyx_t_3 += __pyx_v_R.shape[0];
5672  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5673  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5674  if (unlikely(__pyx_t_2 != -1)) {
5675  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5676  __PYX_ERR(0, 249, __pyx_L1_error)
5677  }
5678  __pyx_t_4 = 0;
5679  __pyx_t_2 = -1;
5680  if (__pyx_t_4 < 0) {
5681  __pyx_t_4 += __pyx_v_node_order.shape[0];
5682  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5683  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5684  if (unlikely(__pyx_t_2 != -1)) {
5685  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5686  __PYX_ERR(0, 249, __pyx_L1_error)
5687  }
5688  __pyx_t_5 = 0;
5689  __pyx_t_2 = -1;
5690  if (__pyx_t_5 < 0) {
5691  __pyx_t_5 += __pyx_v_dX.shape[0];
5692  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5693  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5694  if (unlikely(__pyx_t_2 != -1)) {
5695  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5696  __PYX_ERR(0, 249, __pyx_L1_error)
5697  }
5698  nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5699 
5700  /* "csmoothers.pyx":236
5701  * dX)
5702  *
5703  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5704  * DDATA R,
5705  * IDATA node_order,
5706  */
5707 
5708  /* function exit code */
5709  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5710  goto __pyx_L0;
5711  __pyx_L1_error:;
5712  __Pyx_XDECREF(__pyx_t_1);
5713  __Pyx_AddTraceback("csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5714  __pyx_r = 0;
5715  __pyx_L0:;
5716  __Pyx_XGIVEREF(__pyx_r);
5717  __Pyx_RefNannyFinishContext();
5718  return __pyx_r;
5719 }
5720 
5721 /* "csmoothers.pyx":251
5722  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5723  *
5724  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5725  * """
5726  *
5727  */
5728 
5729 /* Python wrapper */
5730 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5731 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5732 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {"asm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5733 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5734  PyObject *__pyx_v_A = 0;
5735  PyObject *__pyx_v_asmFactor = 0;
5736  int __pyx_lineno = 0;
5737  const char *__pyx_filename = NULL;
5738  int __pyx_clineno = 0;
5739  PyObject *__pyx_r = 0;
5740  __Pyx_RefNannyDeclarations
5741  __Pyx_RefNannySetupContext("asm_NR_prepare (wrapper)", 0);
5742  {
5743  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5744  PyObject* values[2] = {0,0};
5745  if (unlikely(__pyx_kwds)) {
5746  Py_ssize_t kw_args;
5747  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5748  switch (pos_args) {
5749  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5750  CYTHON_FALLTHROUGH;
5751  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5752  CYTHON_FALLTHROUGH;
5753  case 0: break;
5754  default: goto __pyx_L5_argtuple_error;
5755  }
5756  kw_args = PyDict_Size(__pyx_kwds);
5757  switch (pos_args) {
5758  case 0:
5759  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5760  else goto __pyx_L5_argtuple_error;
5761  CYTHON_FALLTHROUGH;
5762  case 1:
5763  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5764  else {
5765  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5766  }
5767  }
5768  if (unlikely(kw_args > 0)) {
5769  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5770  }
5771  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5772  goto __pyx_L5_argtuple_error;
5773  } else {
5774  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5775  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5776  }
5777  __pyx_v_A = values[0];
5778  __pyx_v_asmFactor = values[1];
5779  }
5780  goto __pyx_L4_argument_unpacking_done;
5781  __pyx_L5_argtuple_error:;
5782  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5783  __pyx_L3_error:;
5784  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5785  __Pyx_RefNannyFinishContext();
5786  return NULL;
5787  __pyx_L4_argument_unpacking_done:;
5788  __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5789 
5790  /* function exit code */
5791  __Pyx_RefNannyFinishContext();
5792  return __pyx_r;
5793 }
5794 
5795 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5796  PyObject *__pyx_r = NULL;
5797  __Pyx_RefNannyDeclarations
5798  PyObject *__pyx_t_1 = NULL;
5799  PyObject *__pyx_t_2 = NULL;
5800  int __pyx_lineno = 0;
5801  const char *__pyx_filename = NULL;
5802  int __pyx_clineno = 0;
5803  __Pyx_RefNannySetupContext("asm_NR_prepare", 0);
5804 
5805  /* "csmoothers.pyx":259
5806  * asmFactor :
5807  * """
5808  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5809  * asmFactor._cASMFactor)
5810  *
5811  */
5812  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5813  __Pyx_GOTREF(__pyx_t_1);
5814  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5815 
5816  /* "csmoothers.pyx":260
5817  * """
5818  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix,
5819  * asmFactor._cASMFactor) # <<<<<<<<<<<<<<
5820  *
5821  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm,
5822  */
5823  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5824  __Pyx_GOTREF(__pyx_t_2);
5825  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5826 
5827  /* "csmoothers.pyx":259
5828  * asmFactor :
5829  * """
5830  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5831  * asmFactor._cASMFactor)
5832  *
5833  */
5834  __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5835  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5836  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5837 
5838  /* "csmoothers.pyx":251
5839  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5840  *
5841  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5842  * """
5843  *
5844  */
5845 
5846  /* function exit code */
5847  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5848  goto __pyx_L0;
5849  __pyx_L1_error:;
5850  __Pyx_XDECREF(__pyx_t_1);
5851  __Pyx_XDECREF(__pyx_t_2);
5852  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5853  __pyx_r = NULL;
5854  __pyx_L0:;
5855  __Pyx_XGIVEREF(__pyx_r);
5856  __Pyx_RefNannyFinishContext();
5857  return __pyx_r;
5858 }
5859 
5860 /* "csmoothers.pyx":262
5861  * asmFactor._cASMFactor)
5862  *
5863  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5864  * cASMFactor asmFactor):
5865  * cdef SuperMatrix AS
5866  */
5867 
5868 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5869  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5870  __Pyx_RefNannyDeclarations
5871  PyObject *__pyx_t_1 = NULL;
5872  int __pyx_t_2;
5873  int __pyx_lineno = 0;
5874  const char *__pyx_filename = NULL;
5875  int __pyx_clineno = 0;
5876  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_prepare", 0);
5877 
5878  /* "csmoothers.pyx":265
5879  * cASMFactor asmFactor):
5880  * cdef SuperMatrix AS
5881  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5882  * AS.Dtype = superluWrappers._SLU_D
5883  * AS.Mtype = superluWrappers._SLU_GE
5884  */
5885  __pyx_v_AS.Stype = SLU_NR;
5886 
5887  /* "csmoothers.pyx":266
5888  * cdef SuperMatrix AS
5889  * AS.Stype = superluWrappers._SLU_NR
5890  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5891  * AS.Mtype = superluWrappers._SLU_GE
5892  * AS.nrow = sm.nr
5893  */
5894  __pyx_v_AS.Dtype = SLU_D;
5895 
5896  /* "csmoothers.pyx":267
5897  * AS.Stype = superluWrappers._SLU_NR
5898  * AS.Dtype = superluWrappers._SLU_D
5899  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5900  * AS.nrow = sm.nr
5901  * AS.ncol = sm.nc
5902  */
5903  __pyx_v_AS.Mtype = SLU_GE;
5904 
5905  /* "csmoothers.pyx":268
5906  * AS.Dtype = superluWrappers._SLU_D
5907  * AS.Mtype = superluWrappers._SLU_GE
5908  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5909  * AS.ncol = sm.nc
5910  * AS.Store = &sm.A
5911  */
5912  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5913  __Pyx_GOTREF(__pyx_t_1);
5914  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
5915  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5916  __pyx_v_AS.nrow = __pyx_t_2;
5917 
5918  /* "csmoothers.pyx":269
5919  * AS.Mtype = superluWrappers._SLU_GE
5920  * AS.nrow = sm.nr
5921  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5922  * AS.Store = &sm.A
5923  * casm_NR_prepare(&AS,
5924  */
5925  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
5926  __Pyx_GOTREF(__pyx_t_1);
5927  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
5928  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5929  __pyx_v_AS.ncol = __pyx_t_2;
5930 
5931  /* "csmoothers.pyx":270
5932  * AS.nrow = sm.nr
5933  * AS.ncol = sm.nc
5934  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5935  * casm_NR_prepare(&AS,
5936  * asmFactor.subdomain_dim,
5937  */
5938  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5939 
5940  /* "csmoothers.pyx":271
5941  * AS.ncol = sm.nc
5942  * AS.Store = &sm.A
5943  * casm_NR_prepare(&AS, # <<<<<<<<<<<<<<
5944  * asmFactor.subdomain_dim,
5945  * asmFactor.l2g_L,
5946  */
5947  asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
5948 
5949  /* "csmoothers.pyx":262
5950  * asmFactor._cASMFactor)
5951  *
5952  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5953  * cASMFactor asmFactor):
5954  * cdef SuperMatrix AS
5955  */
5956 
5957  /* function exit code */
5958  goto __pyx_L0;
5959  __pyx_L1_error:;
5960  __Pyx_XDECREF(__pyx_t_1);
5961  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5962  __pyx_L0:;
5963  __Pyx_RefNannyFinishContext();
5964 }
5965 
5966 /* "csmoothers.pyx":277
5967  * asmFactor.subdomain_pivots)
5968  *
5969  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
5970  * """
5971  *
5972  */
5973 
5974 /* Python wrapper */
5975 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5976 static char __pyx_doc_10csmoothers_14asm_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
5977 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {"asm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
5978 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5979  PyObject *__pyx_v_A = 0;
5980  PyObject *__pyx_v_w = 0;
5981  PyObject *__pyx_v_asmFactor = 0;
5982  PyObject *__pyx_v_node_order = 0;
5983  PyObject *__pyx_v_R = 0;
5984  PyObject *__pyx_v_dX = 0;
5985  int __pyx_lineno = 0;
5986  const char *__pyx_filename = NULL;
5987  int __pyx_clineno = 0;
5988  PyObject *__pyx_r = 0;
5989  __Pyx_RefNannyDeclarations
5990  __Pyx_RefNannySetupContext("asm_NR_solve (wrapper)", 0);
5991  {
5992  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
5993  PyObject* values[6] = {0,0,0,0,0,0};
5994  if (unlikely(__pyx_kwds)) {
5995  Py_ssize_t kw_args;
5996  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5997  switch (pos_args) {
5998  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5999  CYTHON_FALLTHROUGH;
6000  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6001  CYTHON_FALLTHROUGH;
6002  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6003  CYTHON_FALLTHROUGH;
6004  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6005  CYTHON_FALLTHROUGH;
6006  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6007  CYTHON_FALLTHROUGH;
6008  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6009  CYTHON_FALLTHROUGH;
6010  case 0: break;
6011  default: goto __pyx_L5_argtuple_error;
6012  }
6013  kw_args = PyDict_Size(__pyx_kwds);
6014  switch (pos_args) {
6015  case 0:
6016  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6017  else goto __pyx_L5_argtuple_error;
6018  CYTHON_FALLTHROUGH;
6019  case 1:
6020  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6021  else {
6022  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
6023  }
6024  CYTHON_FALLTHROUGH;
6025  case 2:
6026  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
6027  else {
6028  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
6029  }
6030  CYTHON_FALLTHROUGH;
6031  case 3:
6032  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6033  else {
6034  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
6035  }
6036  CYTHON_FALLTHROUGH;
6037  case 4:
6038  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6039  else {
6040  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
6041  }
6042  CYTHON_FALLTHROUGH;
6043  case 5:
6044  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6045  else {
6046  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
6047  }
6048  }
6049  if (unlikely(kw_args > 0)) {
6050  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
6051  }
6052  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6053  goto __pyx_L5_argtuple_error;
6054  } else {
6055  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6056  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6057  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6058  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6059  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6060  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6061  }
6062  __pyx_v_A = values[0];
6063  __pyx_v_w = values[1];
6064  __pyx_v_asmFactor = values[2];
6065  __pyx_v_node_order = values[3];
6066  __pyx_v_R = values[4];
6067  __pyx_v_dX = values[5];
6068  }
6069  goto __pyx_L4_argument_unpacking_done;
6070  __pyx_L5_argtuple_error:;
6071  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
6072  __pyx_L3_error:;
6073  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6074  __Pyx_RefNannyFinishContext();
6075  return NULL;
6076  __pyx_L4_argument_unpacking_done:;
6077  __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6078 
6079  /* function exit code */
6080  __Pyx_RefNannyFinishContext();
6081  return __pyx_r;
6082 }
6083 
6084 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6085  PyObject *__pyx_r = NULL;
6086  __Pyx_RefNannyDeclarations
6087  PyObject *__pyx_t_1 = NULL;
6088  double __pyx_t_2;
6089  PyObject *__pyx_t_3 = NULL;
6090  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6091  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6092  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6093  int __pyx_lineno = 0;
6094  const char *__pyx_filename = NULL;
6095  int __pyx_clineno = 0;
6096  __Pyx_RefNannySetupContext("asm_NR_solve", 0);
6097 
6098  /* "csmoothers.pyx":289
6099  * dX : np.array double
6100  * """
6101  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6102  * w,
6103  * asmFactor._cASMFactor,
6104  */
6105  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6106  __Pyx_GOTREF(__pyx_t_1);
6107  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
6108 
6109  /* "csmoothers.pyx":290
6110  * """
6111  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6112  * w, # <<<<<<<<<<<<<<
6113  * asmFactor._cASMFactor,
6114  * node_order,
6115  */
6116  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6117 
6118  /* "csmoothers.pyx":291
6119  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6120  * w,
6121  * asmFactor._cASMFactor, # <<<<<<<<<<<<<<
6122  * node_order,
6123  * R,
6124  */
6125  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6126  __Pyx_GOTREF(__pyx_t_3);
6127  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6128 
6129  /* "csmoothers.pyx":292
6130  * w,
6131  * asmFactor._cASMFactor,
6132  * node_order, # <<<<<<<<<<<<<<
6133  * R,
6134  * dX)
6135  */
6136  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6137 
6138  /* "csmoothers.pyx":293
6139  * asmFactor._cASMFactor,
6140  * node_order,
6141  * R, # <<<<<<<<<<<<<<
6142  * dX)
6143  *
6144  */
6145  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6146 
6147  /* "csmoothers.pyx":294
6148  * node_order,
6149  * R,
6150  * dX) # <<<<<<<<<<<<<<
6151  *
6152  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm,
6153  */
6154  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6155 
6156  /* "csmoothers.pyx":289
6157  * dX : np.array double
6158  * """
6159  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6160  * w,
6161  * asmFactor._cASMFactor,
6162  */
6163  __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6164  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6165  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6166  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6167  __pyx_t_4.memview = NULL;
6168  __pyx_t_4.data = NULL;
6169  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6170  __pyx_t_5.memview = NULL;
6171  __pyx_t_5.data = NULL;
6172  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6173  __pyx_t_6.memview = NULL;
6174  __pyx_t_6.data = NULL;
6175 
6176  /* "csmoothers.pyx":277
6177  * asmFactor.subdomain_pivots)
6178  *
6179  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6180  * """
6181  *
6182  */
6183 
6184  /* function exit code */
6185  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6186  goto __pyx_L0;
6187  __pyx_L1_error:;
6188  __Pyx_XDECREF(__pyx_t_1);
6189  __Pyx_XDECREF(__pyx_t_3);
6190  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6191  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6192  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6193  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6194  __pyx_r = NULL;
6195  __pyx_L0:;
6196  __Pyx_XGIVEREF(__pyx_r);
6197  __Pyx_RefNannyFinishContext();
6198  return __pyx_r;
6199 }
6200 
6201 /* "csmoothers.pyx":296
6202  * dX)
6203  *
6204  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6205  * double w,
6206  * cASMFactor asmFactor,
6207  */
6208 
6209 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6210  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6211  __Pyx_RefNannyDeclarations
6212  PyObject *__pyx_t_1 = NULL;
6213  int __pyx_t_2;
6214  Py_ssize_t __pyx_t_3;
6215  Py_ssize_t __pyx_t_4;
6216  Py_ssize_t __pyx_t_5;
6217  int __pyx_lineno = 0;
6218  const char *__pyx_filename = NULL;
6219  int __pyx_clineno = 0;
6220  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_solve", 0);
6221 
6222  /* "csmoothers.pyx":303
6223  * DDATA dX):
6224  * cdef SuperMatrix AS
6225  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6226  * AS.Dtype = superluWrappers._SLU_D
6227  * AS.Mtype = superluWrappers._SLU_GE
6228  */
6229  __pyx_v_AS.Stype = SLU_NR;
6230 
6231  /* "csmoothers.pyx":304
6232  * cdef SuperMatrix AS
6233  * AS.Stype = superluWrappers._SLU_NR
6234  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6235  * AS.Mtype = superluWrappers._SLU_GE
6236  * AS.nrow = sm.nr
6237  */
6238  __pyx_v_AS.Dtype = SLU_D;
6239 
6240  /* "csmoothers.pyx":305
6241  * AS.Stype = superluWrappers._SLU_NR
6242  * AS.Dtype = superluWrappers._SLU_D
6243  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6244  * AS.nrow = sm.nr
6245  * AS.ncol = sm.nc
6246  */
6247  __pyx_v_AS.Mtype = SLU_GE;
6248 
6249  /* "csmoothers.pyx":306
6250  * AS.Dtype = superluWrappers._SLU_D
6251  * AS.Mtype = superluWrappers._SLU_GE
6252  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6253  * AS.ncol = sm.nc
6254  * AS.Store = &sm.A
6255  */
6256  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6257  __Pyx_GOTREF(__pyx_t_1);
6258  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6259  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6260  __pyx_v_AS.nrow = __pyx_t_2;
6261 
6262  /* "csmoothers.pyx":307
6263  * AS.Mtype = superluWrappers._SLU_GE
6264  * AS.nrow = sm.nr
6265  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6266  * AS.Store = &sm.A
6267  * casm_NR_solve(&AS,
6268  */
6269  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6270  __Pyx_GOTREF(__pyx_t_1);
6271  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6272  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6273  __pyx_v_AS.ncol = __pyx_t_2;
6274 
6275  /* "csmoothers.pyx":308
6276  * AS.nrow = sm.nr
6277  * AS.ncol = sm.nc
6278  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6279  * casm_NR_solve(&AS,
6280  * w,
6281  */
6282  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6283 
6284  /* "csmoothers.pyx":314
6285  * asmFactor.subdomain_dim,
6286  * asmFactor.l2g_L,
6287  * &R[0], # <<<<<<<<<<<<<<
6288  * asmFactor.subdomain_R,
6289  * &node_order[0],
6290  */
6291  __pyx_t_3 = 0;
6292  __pyx_t_2 = -1;
6293  if (__pyx_t_3 < 0) {
6294  __pyx_t_3 += __pyx_v_R.shape[0];
6295  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6296  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6297  if (unlikely(__pyx_t_2 != -1)) {
6298  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6299  __PYX_ERR(0, 314, __pyx_L1_error)
6300  }
6301 
6302  /* "csmoothers.pyx":316
6303  * &R[0],
6304  * asmFactor.subdomain_R,
6305  * &node_order[0], # <<<<<<<<<<<<<<
6306  * asmFactor.subdomain_dX,
6307  * &dX[0],
6308  */
6309  __pyx_t_4 = 0;
6310  __pyx_t_2 = -1;
6311  if (__pyx_t_4 < 0) {
6312  __pyx_t_4 += __pyx_v_node_order.shape[0];
6313  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6314  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6315  if (unlikely(__pyx_t_2 != -1)) {
6316  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6317  __PYX_ERR(0, 316, __pyx_L1_error)
6318  }
6319 
6320  /* "csmoothers.pyx":318
6321  * &node_order[0],
6322  * asmFactor.subdomain_dX,
6323  * &dX[0], # <<<<<<<<<<<<<<
6324  * asmFactor.subdomain_pivots)
6325  *
6326  */
6327  __pyx_t_5 = 0;
6328  __pyx_t_2 = -1;
6329  if (__pyx_t_5 < 0) {
6330  __pyx_t_5 += __pyx_v_dX.shape[0];
6331  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6332  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6333  if (unlikely(__pyx_t_2 != -1)) {
6334  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6335  __PYX_ERR(0, 318, __pyx_L1_error)
6336  }
6337 
6338  /* "csmoothers.pyx":309
6339  * AS.ncol = sm.nc
6340  * AS.Store = &sm.A
6341  * casm_NR_solve(&AS, # <<<<<<<<<<<<<<
6342  * w,
6343  * asmFactor.subdomain_L,
6344  */
6345  asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6346 
6347  /* "csmoothers.pyx":296
6348  * dX)
6349  *
6350  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6351  * double w,
6352  * cASMFactor asmFactor,
6353  */
6354 
6355  /* function exit code */
6356  goto __pyx_L0;
6357  __pyx_L1_error:;
6358  __Pyx_XDECREF(__pyx_t_1);
6359  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6360  __pyx_L0:;
6361  __Pyx_RefNannyFinishContext();
6362 }
6363 
6364 /* "csmoothers.pyx":321
6365  * asmFactor.subdomain_pivots)
6366  *
6367  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6368  * """
6369  *
6370  */
6371 
6372 /* Python wrapper */
6373 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6374 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6375 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {"basm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6376 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6377  PyObject *__pyx_v_A = 0;
6378  PyObject *__pyx_v_basmFactor = 0;
6379  int __pyx_lineno = 0;
6380  const char *__pyx_filename = NULL;
6381  int __pyx_clineno = 0;
6382  PyObject *__pyx_r = 0;
6383  __Pyx_RefNannyDeclarations
6384  __Pyx_RefNannySetupContext("basm_NR_prepare (wrapper)", 0);
6385  {
6386  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6387  PyObject* values[2] = {0,0};
6388  if (unlikely(__pyx_kwds)) {
6389  Py_ssize_t kw_args;
6390  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6391  switch (pos_args) {
6392  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6393  CYTHON_FALLTHROUGH;
6394  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6395  CYTHON_FALLTHROUGH;
6396  case 0: break;
6397  default: goto __pyx_L5_argtuple_error;
6398  }
6399  kw_args = PyDict_Size(__pyx_kwds);
6400  switch (pos_args) {
6401  case 0:
6402  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6403  else goto __pyx_L5_argtuple_error;
6404  CYTHON_FALLTHROUGH;
6405  case 1:
6406  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6407  else {
6408  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6409  }
6410  }
6411  if (unlikely(kw_args > 0)) {
6412  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6413  }
6414  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6415  goto __pyx_L5_argtuple_error;
6416  } else {
6417  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6418  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6419  }
6420  __pyx_v_A = values[0];
6421  __pyx_v_basmFactor = values[1];
6422  }
6423  goto __pyx_L4_argument_unpacking_done;
6424  __pyx_L5_argtuple_error:;
6425  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6426  __pyx_L3_error:;
6427  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6428  __Pyx_RefNannyFinishContext();
6429  return NULL;
6430  __pyx_L4_argument_unpacking_done:;
6431  __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6432 
6433  /* function exit code */
6434  __Pyx_RefNannyFinishContext();
6435  return __pyx_r;
6436 }
6437 
6438 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6439  PyObject *__pyx_r = NULL;
6440  __Pyx_RefNannyDeclarations
6441  PyObject *__pyx_t_1 = NULL;
6442  PyObject *__pyx_t_2 = NULL;
6443  int __pyx_lineno = 0;
6444  const char *__pyx_filename = NULL;
6445  int __pyx_clineno = 0;
6446  __Pyx_RefNannySetupContext("basm_NR_prepare", 0);
6447 
6448  /* "csmoothers.pyx":329
6449  * basmFactor :
6450  * """
6451  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6452  * basmFactor._cBASMFactor)
6453  *
6454  */
6455  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6456  __Pyx_GOTREF(__pyx_t_1);
6457  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6458 
6459  /* "csmoothers.pyx":330
6460  * """
6461  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix,
6462  * basmFactor._cBASMFactor) # <<<<<<<<<<<<<<
6463  *
6464  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm,
6465  */
6466  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6467  __Pyx_GOTREF(__pyx_t_2);
6468  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6469 
6470  /* "csmoothers.pyx":329
6471  * basmFactor :
6472  * """
6473  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6474  * basmFactor._cBASMFactor)
6475  *
6476  */
6477  __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6478  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6479  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6480 
6481  /* "csmoothers.pyx":321
6482  * asmFactor.subdomain_pivots)
6483  *
6484  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6485  * """
6486  *
6487  */
6488 
6489  /* function exit code */
6490  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6491  goto __pyx_L0;
6492  __pyx_L1_error:;
6493  __Pyx_XDECREF(__pyx_t_1);
6494  __Pyx_XDECREF(__pyx_t_2);
6495  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6496  __pyx_r = NULL;
6497  __pyx_L0:;
6498  __Pyx_XGIVEREF(__pyx_r);
6499  __Pyx_RefNannyFinishContext();
6500  return __pyx_r;
6501 }
6502 
6503 /* "csmoothers.pyx":332
6504  * basmFactor._cBASMFactor)
6505  *
6506  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6507  * cBASMFactor basmFactor):
6508  * cdef SuperMatrix AS
6509  */
6510 
6511 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6512  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6513  __Pyx_RefNannyDeclarations
6514  PyObject *__pyx_t_1 = NULL;
6515  int __pyx_t_2;
6516  int __pyx_lineno = 0;
6517  const char *__pyx_filename = NULL;
6518  int __pyx_clineno = 0;
6519  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_prepare", 0);
6520 
6521  /* "csmoothers.pyx":335
6522  * cBASMFactor basmFactor):
6523  * cdef SuperMatrix AS
6524  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6525  * AS.Mtype = superluWrappers._SLU_GE
6526  * AS.nrow = sm.nr
6527  */
6528  __pyx_v_AS.Dtype = SLU_D;
6529 
6530  /* "csmoothers.pyx":336
6531  * cdef SuperMatrix AS
6532  * AS.Dtype = superluWrappers._SLU_D
6533  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6534  * AS.nrow = sm.nr
6535  * AS.ncol = sm.nc
6536  */
6537  __pyx_v_AS.Mtype = SLU_GE;
6538 
6539  /* "csmoothers.pyx":337
6540  * AS.Dtype = superluWrappers._SLU_D
6541  * AS.Mtype = superluWrappers._SLU_GE
6542  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6543  * AS.ncol = sm.nc
6544  * AS.Store = &sm.A
6545  */
6546  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6547  __Pyx_GOTREF(__pyx_t_1);
6548  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6549  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6550  __pyx_v_AS.nrow = __pyx_t_2;
6551 
6552  /* "csmoothers.pyx":338
6553  * AS.Mtype = superluWrappers._SLU_GE
6554  * AS.nrow = sm.nr
6555  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6556  * AS.Store = &sm.A
6557  * cbasm_NR_prepare(basmFactor.bs,
6558  */
6559  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6560  __Pyx_GOTREF(__pyx_t_1);
6561  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6562  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6563  __pyx_v_AS.ncol = __pyx_t_2;
6564 
6565  /* "csmoothers.pyx":339
6566  * AS.nrow = sm.nr
6567  * AS.ncol = sm.nc
6568  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6569  * cbasm_NR_prepare(basmFactor.bs,
6570  * basmFactor.N,
6571  */
6572  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6573 
6574  /* "csmoothers.pyx":340
6575  * AS.ncol = sm.nc
6576  * AS.Store = &sm.A
6577  * cbasm_NR_prepare(basmFactor.bs, # <<<<<<<<<<<<<<
6578  * basmFactor.N,
6579  * &AS,
6580  */
6581  basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6582 
6583  /* "csmoothers.pyx":332
6584  * basmFactor._cBASMFactor)
6585  *
6586  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6587  * cBASMFactor basmFactor):
6588  * cdef SuperMatrix AS
6589  */
6590 
6591  /* function exit code */
6592  goto __pyx_L0;
6593  __pyx_L1_error:;
6594  __Pyx_XDECREF(__pyx_t_1);
6595  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6596  __pyx_L0:;
6597  __Pyx_RefNannyFinishContext();
6598 }
6599 
6600 /* "csmoothers.pyx":350
6601  *
6602  *
6603  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6604  * """
6605  *
6606  */
6607 
6608 /* Python wrapper */
6609 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6610 static char __pyx_doc_10csmoothers_18basm_NR_solve[] = "\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6611 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {"basm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6612 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6613  PyObject *__pyx_v_A = 0;
6614  PyObject *__pyx_v_w = 0;
6615  PyObject *__pyx_v_basmFactor = 0;
6616  PyObject *__pyx_v_node_order = 0;
6617  PyObject *__pyx_v_R = 0;
6618  PyObject *__pyx_v_dX = 0;
6619  int __pyx_lineno = 0;
6620  const char *__pyx_filename = NULL;
6621  int __pyx_clineno = 0;
6622  PyObject *__pyx_r = 0;
6623  __Pyx_RefNannyDeclarations
6624  __Pyx_RefNannySetupContext("basm_NR_solve (wrapper)", 0);
6625  {
6626  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6627  PyObject* values[6] = {0,0,0,0,0,0};
6628  if (unlikely(__pyx_kwds)) {
6629  Py_ssize_t kw_args;
6630  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6631  switch (pos_args) {
6632  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6633  CYTHON_FALLTHROUGH;
6634  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6635  CYTHON_FALLTHROUGH;
6636  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6637  CYTHON_FALLTHROUGH;
6638  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6639  CYTHON_FALLTHROUGH;
6640  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6641  CYTHON_FALLTHROUGH;
6642  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6643  CYTHON_FALLTHROUGH;
6644  case 0: break;
6645  default: goto __pyx_L5_argtuple_error;
6646  }
6647  kw_args = PyDict_Size(__pyx_kwds);
6648  switch (pos_args) {
6649  case 0:
6650  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6651  else goto __pyx_L5_argtuple_error;
6652  CYTHON_FALLTHROUGH;
6653  case 1:
6654  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6655  else {
6656  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6657  }
6658  CYTHON_FALLTHROUGH;
6659  case 2:
6660  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6661  else {
6662  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6663  }
6664  CYTHON_FALLTHROUGH;
6665  case 3:
6666  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6667  else {
6668  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6669  }
6670  CYTHON_FALLTHROUGH;
6671  case 4:
6672  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6673  else {
6674  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6675  }
6676  CYTHON_FALLTHROUGH;
6677  case 5:
6678  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6679  else {
6680  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6681  }
6682  }
6683  if (unlikely(kw_args > 0)) {
6684  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6685  }
6686  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6687  goto __pyx_L5_argtuple_error;
6688  } else {
6689  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6690  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6691  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6692  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6693  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6694  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6695  }
6696  __pyx_v_A = values[0];
6697  __pyx_v_w = values[1];
6698  __pyx_v_basmFactor = values[2];
6699  __pyx_v_node_order = values[3];
6700  __pyx_v_R = values[4];
6701  __pyx_v_dX = values[5];
6702  }
6703  goto __pyx_L4_argument_unpacking_done;
6704  __pyx_L5_argtuple_error:;
6705  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6706  __pyx_L3_error:;
6707  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6708  __Pyx_RefNannyFinishContext();
6709  return NULL;
6710  __pyx_L4_argument_unpacking_done:;
6711  __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6712 
6713  /* function exit code */
6714  __Pyx_RefNannyFinishContext();
6715  return __pyx_r;
6716 }
6717 
6718 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6719  PyObject *__pyx_r = NULL;
6720  __Pyx_RefNannyDeclarations
6721  PyObject *__pyx_t_1 = NULL;
6722  double __pyx_t_2;
6723  PyObject *__pyx_t_3 = NULL;
6724  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6725  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6726  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6727  int __pyx_lineno = 0;
6728  const char *__pyx_filename = NULL;
6729  int __pyx_clineno = 0;
6730  __Pyx_RefNannySetupContext("basm_NR_solve", 0);
6731 
6732  /* "csmoothers.pyx":362
6733  * dX :
6734  * """
6735  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6736  * w,
6737  * basmFactor._cBASMFactor,
6738  */
6739  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6740  __Pyx_GOTREF(__pyx_t_1);
6741  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6742 
6743  /* "csmoothers.pyx":363
6744  * """
6745  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6746  * w, # <<<<<<<<<<<<<<
6747  * basmFactor._cBASMFactor,
6748  * node_order,
6749  */
6750  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6751 
6752  /* "csmoothers.pyx":364
6753  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6754  * w,
6755  * basmFactor._cBASMFactor, # <<<<<<<<<<<<<<
6756  * node_order,
6757  * R,
6758  */
6759  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6760  __Pyx_GOTREF(__pyx_t_3);
6761  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6762 
6763  /* "csmoothers.pyx":365
6764  * w,
6765  * basmFactor._cBASMFactor,
6766  * node_order, # <<<<<<<<<<<<<<
6767  * R,
6768  * dX)
6769  */
6770  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6771 
6772  /* "csmoothers.pyx":366
6773  * basmFactor._cBASMFactor,
6774  * node_order,
6775  * R, # <<<<<<<<<<<<<<
6776  * dX)
6777  *
6778  */
6779  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6780 
6781  /* "csmoothers.pyx":367
6782  * node_order,
6783  * R,
6784  * dX) # <<<<<<<<<<<<<<
6785  *
6786  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm,
6787  */
6788  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6789 
6790  /* "csmoothers.pyx":362
6791  * dX :
6792  * """
6793  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6794  * w,
6795  * basmFactor._cBASMFactor,
6796  */
6797  __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6798  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6799  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6800  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6801  __pyx_t_4.memview = NULL;
6802  __pyx_t_4.data = NULL;
6803  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6804  __pyx_t_5.memview = NULL;
6805  __pyx_t_5.data = NULL;
6806  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6807  __pyx_t_6.memview = NULL;
6808  __pyx_t_6.data = NULL;
6809 
6810  /* "csmoothers.pyx":350
6811  *
6812  *
6813  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6814  * """
6815  *
6816  */
6817 
6818  /* function exit code */
6819  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6820  goto __pyx_L0;
6821  __pyx_L1_error:;
6822  __Pyx_XDECREF(__pyx_t_1);
6823  __Pyx_XDECREF(__pyx_t_3);
6824  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6825  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6826  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6827  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6828  __pyx_r = NULL;
6829  __pyx_L0:;
6830  __Pyx_XGIVEREF(__pyx_r);
6831  __Pyx_RefNannyFinishContext();
6832  return __pyx_r;
6833 }
6834 
6835 /* "csmoothers.pyx":369
6836  * dX)
6837  *
6838  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6839  * double w,
6840  * cBASMFactor basmFactor,
6841  */
6842 
6843 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6844  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6845  __Pyx_RefNannyDeclarations
6846  PyObject *__pyx_t_1 = NULL;
6847  int __pyx_t_2;
6848  Py_ssize_t __pyx_t_3;
6849  Py_ssize_t __pyx_t_4;
6850  Py_ssize_t __pyx_t_5;
6851  int __pyx_lineno = 0;
6852  const char *__pyx_filename = NULL;
6853  int __pyx_clineno = 0;
6854  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_solve", 0);
6855 
6856  /* "csmoothers.pyx":376
6857  * DDATA dX):
6858  * cdef SuperMatrix AS
6859  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6860  * AS.Dtype = superluWrappers._SLU_D
6861  * AS.Mtype = superluWrappers._SLU_GE
6862  */
6863  __pyx_v_AS.Stype = SLU_NR;
6864 
6865  /* "csmoothers.pyx":377
6866  * cdef SuperMatrix AS
6867  * AS.Stype = superluWrappers._SLU_NR
6868  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6869  * AS.Mtype = superluWrappers._SLU_GE
6870  * AS.nrow = sm.nr
6871  */
6872  __pyx_v_AS.Dtype = SLU_D;
6873 
6874  /* "csmoothers.pyx":378
6875  * AS.Stype = superluWrappers._SLU_NR
6876  * AS.Dtype = superluWrappers._SLU_D
6877  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6878  * AS.nrow = sm.nr
6879  * AS.ncol = sm.nc
6880  */
6881  __pyx_v_AS.Mtype = SLU_GE;
6882 
6883  /* "csmoothers.pyx":379
6884  * AS.Dtype = superluWrappers._SLU_D
6885  * AS.Mtype = superluWrappers._SLU_GE
6886  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6887  * AS.ncol = sm.nc
6888  * AS.Store = &sm.A
6889  */
6890  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6891  __Pyx_GOTREF(__pyx_t_1);
6892  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6893  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6894  __pyx_v_AS.nrow = __pyx_t_2;
6895 
6896  /* "csmoothers.pyx":380
6897  * AS.Mtype = superluWrappers._SLU_GE
6898  * AS.nrow = sm.nr
6899  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6900  * AS.Store = &sm.A
6901  * cbasm_NR_solve(basmFactor.bs,
6902  */
6903  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
6904  __Pyx_GOTREF(__pyx_t_1);
6905  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
6906  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6907  __pyx_v_AS.ncol = __pyx_t_2;
6908 
6909  /* "csmoothers.pyx":381
6910  * AS.nrow = sm.nr
6911  * AS.ncol = sm.nc
6912  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6913  * cbasm_NR_solve(basmFactor.bs,
6914  * basmFactor.N,
6915  */
6916  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6917 
6918  /* "csmoothers.pyx":389
6919  * basmFactor.subdomain_dim,
6920  * basmFactor.l2g_L,
6921  * &R[0], # <<<<<<<<<<<<<<
6922  * basmFactor.subdomain_R,
6923  * &node_order[0],
6924  */
6925  __pyx_t_3 = 0;
6926  __pyx_t_2 = -1;
6927  if (__pyx_t_3 < 0) {
6928  __pyx_t_3 += __pyx_v_R.shape[0];
6929  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6930  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6931  if (unlikely(__pyx_t_2 != -1)) {
6932  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6933  __PYX_ERR(0, 389, __pyx_L1_error)
6934  }
6935 
6936  /* "csmoothers.pyx":391
6937  * &R[0],
6938  * basmFactor.subdomain_R,
6939  * &node_order[0], # <<<<<<<<<<<<<<
6940  * basmFactor.subdomain_dX,
6941  * &dX[0],
6942  */
6943  __pyx_t_4 = 0;
6944  __pyx_t_2 = -1;
6945  if (__pyx_t_4 < 0) {
6946  __pyx_t_4 += __pyx_v_node_order.shape[0];
6947  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6948  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6949  if (unlikely(__pyx_t_2 != -1)) {
6950  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6951  __PYX_ERR(0, 391, __pyx_L1_error)
6952  }
6953 
6954  /* "csmoothers.pyx":393
6955  * &node_order[0],
6956  * basmFactor.subdomain_dX,
6957  * &dX[0], # <<<<<<<<<<<<<<
6958  * basmFactor.subdomain_pivots,
6959  * basmFactor.subdomain_col_pivots)
6960  */
6961  __pyx_t_5 = 0;
6962  __pyx_t_2 = -1;
6963  if (__pyx_t_5 < 0) {
6964  __pyx_t_5 += __pyx_v_dX.shape[0];
6965  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6966  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6967  if (unlikely(__pyx_t_2 != -1)) {
6968  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6969  __PYX_ERR(0, 393, __pyx_L1_error)
6970  }
6971 
6972  /* "csmoothers.pyx":382
6973  * AS.ncol = sm.nc
6974  * AS.Store = &sm.A
6975  * cbasm_NR_solve(basmFactor.bs, # <<<<<<<<<<<<<<
6976  * basmFactor.N,
6977  * &AS,
6978  */
6979  basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6980 
6981  /* "csmoothers.pyx":369
6982  * dX)
6983  *
6984  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6985  * double w,
6986  * cBASMFactor basmFactor,
6987  */
6988 
6989  /* function exit code */
6990  goto __pyx_L0;
6991  __pyx_L1_error:;
6992  __Pyx_XDECREF(__pyx_t_1);
6993  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6994  __pyx_L0:;
6995  __Pyx_RefNannyFinishContext();
6996 }
6997 
6998 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
6999  * ctypedef npy_cdouble complex_t
7000  *
7001  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7002  * return PyArray_MultiIterNew(1, <void*>a)
7003  *
7004  */
7005 
7006 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7007  PyObject *__pyx_r = NULL;
7008  __Pyx_RefNannyDeclarations
7009  PyObject *__pyx_t_1 = NULL;
7010  int __pyx_lineno = 0;
7011  const char *__pyx_filename = NULL;
7012  int __pyx_clineno = 0;
7013  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7014 
7015  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":736
7016  *
7017  * cdef inline object PyArray_MultiIterNew1(a):
7018  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7019  *
7020  * cdef inline object PyArray_MultiIterNew2(a, b):
7021  */
7022  __Pyx_XDECREF(__pyx_r);
7023  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
7024  __Pyx_GOTREF(__pyx_t_1);
7025  __pyx_r = __pyx_t_1;
7026  __pyx_t_1 = 0;
7027  goto __pyx_L0;
7028 
7029  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":735
7030  * ctypedef npy_cdouble complex_t
7031  *
7032  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7033  * return PyArray_MultiIterNew(1, <void*>a)
7034  *
7035  */
7036 
7037  /* function exit code */
7038  __pyx_L1_error:;
7039  __Pyx_XDECREF(__pyx_t_1);
7040  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7041  __pyx_r = 0;
7042  __pyx_L0:;
7043  __Pyx_XGIVEREF(__pyx_r);
7044  __Pyx_RefNannyFinishContext();
7045  return __pyx_r;
7046 }
7047 
7048 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
7049  * return PyArray_MultiIterNew(1, <void*>a)
7050  *
7051  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7052  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7053  *
7054  */
7055 
7056 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7057  PyObject *__pyx_r = NULL;
7058  __Pyx_RefNannyDeclarations
7059  PyObject *__pyx_t_1 = NULL;
7060  int __pyx_lineno = 0;
7061  const char *__pyx_filename = NULL;
7062  int __pyx_clineno = 0;
7063  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7064 
7065  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":739
7066  *
7067  * cdef inline object PyArray_MultiIterNew2(a, b):
7068  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7069  *
7070  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7071  */
7072  __Pyx_XDECREF(__pyx_r);
7073  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
7074  __Pyx_GOTREF(__pyx_t_1);
7075  __pyx_r = __pyx_t_1;
7076  __pyx_t_1 = 0;
7077  goto __pyx_L0;
7078 
7079  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":738
7080  * return PyArray_MultiIterNew(1, <void*>a)
7081  *
7082  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7083  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7084  *
7085  */
7086 
7087  /* function exit code */
7088  __pyx_L1_error:;
7089  __Pyx_XDECREF(__pyx_t_1);
7090  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7091  __pyx_r = 0;
7092  __pyx_L0:;
7093  __Pyx_XGIVEREF(__pyx_r);
7094  __Pyx_RefNannyFinishContext();
7095  return __pyx_r;
7096 }
7097 
7098 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
7099  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7100  *
7101  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7102  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7103  *
7104  */
7105 
7106 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7107  PyObject *__pyx_r = NULL;
7108  __Pyx_RefNannyDeclarations
7109  PyObject *__pyx_t_1 = NULL;
7110  int __pyx_lineno = 0;
7111  const char *__pyx_filename = NULL;
7112  int __pyx_clineno = 0;
7113  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7114 
7115  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":742
7116  *
7117  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7118  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7119  *
7120  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7121  */
7122  __Pyx_XDECREF(__pyx_r);
7123  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
7124  __Pyx_GOTREF(__pyx_t_1);
7125  __pyx_r = __pyx_t_1;
7126  __pyx_t_1 = 0;
7127  goto __pyx_L0;
7128 
7129  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":741
7130  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7131  *
7132  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7133  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7134  *
7135  */
7136 
7137  /* function exit code */
7138  __pyx_L1_error:;
7139  __Pyx_XDECREF(__pyx_t_1);
7140  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7141  __pyx_r = 0;
7142  __pyx_L0:;
7143  __Pyx_XGIVEREF(__pyx_r);
7144  __Pyx_RefNannyFinishContext();
7145  return __pyx_r;
7146 }
7147 
7148 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
7149  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7150  *
7151  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7152  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7153  *
7154  */
7155 
7156 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7157  PyObject *__pyx_r = NULL;
7158  __Pyx_RefNannyDeclarations
7159  PyObject *__pyx_t_1 = NULL;
7160  int __pyx_lineno = 0;
7161  const char *__pyx_filename = NULL;
7162  int __pyx_clineno = 0;
7163  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7164 
7165  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":745
7166  *
7167  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7168  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7169  *
7170  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7171  */
7172  __Pyx_XDECREF(__pyx_r);
7173  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
7174  __Pyx_GOTREF(__pyx_t_1);
7175  __pyx_r = __pyx_t_1;
7176  __pyx_t_1 = 0;
7177  goto __pyx_L0;
7178 
7179  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":744
7180  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7181  *
7182  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7183  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7184  *
7185  */
7186 
7187  /* function exit code */
7188  __pyx_L1_error:;
7189  __Pyx_XDECREF(__pyx_t_1);
7190  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7191  __pyx_r = 0;
7192  __pyx_L0:;
7193  __Pyx_XGIVEREF(__pyx_r);
7194  __Pyx_RefNannyFinishContext();
7195  return __pyx_r;
7196 }
7197 
7198 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
7199  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7200  *
7201  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7202  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7203  *
7204  */
7205 
7206 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
7207  PyObject *__pyx_r = NULL;
7208  __Pyx_RefNannyDeclarations
7209  PyObject *__pyx_t_1 = NULL;
7210  int __pyx_lineno = 0;
7211  const char *__pyx_filename = NULL;
7212  int __pyx_clineno = 0;
7213  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7214 
7215  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":748
7216  *
7217  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7218  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7219  *
7220  * cdef inline tuple PyDataType_SHAPE(dtype d):
7221  */
7222  __Pyx_XDECREF(__pyx_r);
7223  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
7224  __Pyx_GOTREF(__pyx_t_1);
7225  __pyx_r = __pyx_t_1;
7226  __pyx_t_1 = 0;
7227  goto __pyx_L0;
7228 
7229  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":747
7230  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7231  *
7232  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7233  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7234  *
7235  */
7236 
7237  /* function exit code */
7238  __pyx_L1_error:;
7239  __Pyx_XDECREF(__pyx_t_1);
7240  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7241  __pyx_r = 0;
7242  __pyx_L0:;
7243  __Pyx_XGIVEREF(__pyx_r);
7244  __Pyx_RefNannyFinishContext();
7245  return __pyx_r;
7246 }
7247 
7248 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
7249  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7250  *
7251  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7252  * if PyDataType_HASSUBARRAY(d):
7253  * return <tuple>d.subarray.shape
7254  */
7255 
7256 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7257  PyObject *__pyx_r = NULL;
7258  __Pyx_RefNannyDeclarations
7259  int __pyx_t_1;
7260  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7261 
7262  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
7263  *
7264  * cdef inline tuple PyDataType_SHAPE(dtype d):
7265  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7266  * return <tuple>d.subarray.shape
7267  * else:
7268  */
7269  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7270  if (__pyx_t_1) {
7271 
7272  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":752
7273  * cdef inline tuple PyDataType_SHAPE(dtype d):
7274  * if PyDataType_HASSUBARRAY(d):
7275  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7276  * else:
7277  * return ()
7278  */
7279  __Pyx_XDECREF(__pyx_r);
7280  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7281  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7282  goto __pyx_L0;
7283 
7284  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":751
7285  *
7286  * cdef inline tuple PyDataType_SHAPE(dtype d):
7287  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7288  * return <tuple>d.subarray.shape
7289  * else:
7290  */
7291  }
7292 
7293  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":754
7294  * return <tuple>d.subarray.shape
7295  * else:
7296  * return () # <<<<<<<<<<<<<<
7297  *
7298  *
7299  */
7300  /*else*/ {
7301  __Pyx_XDECREF(__pyx_r);
7302  __Pyx_INCREF(__pyx_empty_tuple);
7303  __pyx_r = __pyx_empty_tuple;
7304  goto __pyx_L0;
7305  }
7306 
7307  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":750
7308  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7309  *
7310  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7311  * if PyDataType_HASSUBARRAY(d):
7312  * return <tuple>d.subarray.shape
7313  */
7314 
7315  /* function exit code */
7316  __pyx_L0:;
7317  __Pyx_XGIVEREF(__pyx_r);
7318  __Pyx_RefNannyFinishContext();
7319  return __pyx_r;
7320 }
7321 
7322 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
7323  * int _import_umath() except -1
7324  *
7325  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7326  * Py_INCREF(base) # important to do this before stealing the reference below!
7327  * PyArray_SetBaseObject(arr, base)
7328  */
7329 
7330 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7331  __Pyx_RefNannyDeclarations
7332  __Pyx_RefNannySetupContext("set_array_base", 0);
7333 
7334  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":930
7335  *
7336  * cdef inline void set_array_base(ndarray arr, object base):
7337  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7338  * PyArray_SetBaseObject(arr, base)
7339  *
7340  */
7341  Py_INCREF(__pyx_v_base);
7342 
7343  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":931
7344  * cdef inline void set_array_base(ndarray arr, object base):
7345  * Py_INCREF(base) # important to do this before stealing the reference below!
7346  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7347  *
7348  * cdef inline object get_array_base(ndarray arr):
7349  */
7350  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7351 
7352  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":929
7353  * int _import_umath() except -1
7354  *
7355  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7356  * Py_INCREF(base) # important to do this before stealing the reference below!
7357  * PyArray_SetBaseObject(arr, base)
7358  */
7359 
7360  /* function exit code */
7361  __Pyx_RefNannyFinishContext();
7362 }
7363 
7364 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
7365  * PyArray_SetBaseObject(arr, base)
7366  *
7367  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7368  * base = PyArray_BASE(arr)
7369  * if base is NULL:
7370  */
7371 
7372 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7373  PyObject *__pyx_v_base;
7374  PyObject *__pyx_r = NULL;
7375  __Pyx_RefNannyDeclarations
7376  int __pyx_t_1;
7377  __Pyx_RefNannySetupContext("get_array_base", 0);
7378 
7379  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":934
7380  *
7381  * cdef inline object get_array_base(ndarray arr):
7382  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7383  * if base is NULL:
7384  * return None
7385  */
7386  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7387 
7388  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
7389  * cdef inline object get_array_base(ndarray arr):
7390  * base = PyArray_BASE(arr)
7391  * if base is NULL: # <<<<<<<<<<<<<<
7392  * return None
7393  * return <object>base
7394  */
7395  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7396  if (__pyx_t_1) {
7397 
7398  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":936
7399  * base = PyArray_BASE(arr)
7400  * if base is NULL:
7401  * return None # <<<<<<<<<<<<<<
7402  * return <object>base
7403  *
7404  */
7405  __Pyx_XDECREF(__pyx_r);
7406  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7407  goto __pyx_L0;
7408 
7409  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":935
7410  * cdef inline object get_array_base(ndarray arr):
7411  * base = PyArray_BASE(arr)
7412  * if base is NULL: # <<<<<<<<<<<<<<
7413  * return None
7414  * return <object>base
7415  */
7416  }
7417 
7418  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":937
7419  * if base is NULL:
7420  * return None
7421  * return <object>base # <<<<<<<<<<<<<<
7422  *
7423  * # Versions of the import_* functions which are more suitable for
7424  */
7425  __Pyx_XDECREF(__pyx_r);
7426  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7427  __pyx_r = ((PyObject *)__pyx_v_base);
7428  goto __pyx_L0;
7429 
7430  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":933
7431  * PyArray_SetBaseObject(arr, base)
7432  *
7433  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7434  * base = PyArray_BASE(arr)
7435  * if base is NULL:
7436  */
7437 
7438  /* function exit code */
7439  __pyx_L0:;
7440  __Pyx_XGIVEREF(__pyx_r);
7441  __Pyx_RefNannyFinishContext();
7442  return __pyx_r;
7443 }
7444 
7445 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
7446  * # Versions of the import_* functions which are more suitable for
7447  * # Cython code.
7448  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7449  * try:
7450  * __pyx_import_array()
7451  */
7452 
7453 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7454  int __pyx_r;
7455  __Pyx_RefNannyDeclarations
7456  PyObject *__pyx_t_1 = NULL;
7457  PyObject *__pyx_t_2 = NULL;
7458  PyObject *__pyx_t_3 = NULL;
7459  int __pyx_t_4;
7460  PyObject *__pyx_t_5 = NULL;
7461  PyObject *__pyx_t_6 = NULL;
7462  PyObject *__pyx_t_7 = NULL;
7463  PyObject *__pyx_t_8 = NULL;
7464  int __pyx_lineno = 0;
7465  const char *__pyx_filename = NULL;
7466  int __pyx_clineno = 0;
7467  __Pyx_RefNannySetupContext("import_array", 0);
7468 
7469  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7470  * # Cython code.
7471  * cdef inline int import_array() except -1:
7472  * try: # <<<<<<<<<<<<<<
7473  * __pyx_import_array()
7474  * except Exception:
7475  */
7476  {
7477  __Pyx_PyThreadState_declare
7478  __Pyx_PyThreadState_assign
7479  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7480  __Pyx_XGOTREF(__pyx_t_1);
7481  __Pyx_XGOTREF(__pyx_t_2);
7482  __Pyx_XGOTREF(__pyx_t_3);
7483  /*try:*/ {
7484 
7485  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":943
7486  * cdef inline int import_array() except -1:
7487  * try:
7488  * __pyx_import_array() # <<<<<<<<<<<<<<
7489  * except Exception:
7490  * raise ImportError("numpy.core.multiarray failed to import")
7491  */
7492  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
7493 
7494  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7495  * # Cython code.
7496  * cdef inline int import_array() except -1:
7497  * try: # <<<<<<<<<<<<<<
7498  * __pyx_import_array()
7499  * except Exception:
7500  */
7501  }
7502  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7503  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7504  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7505  goto __pyx_L8_try_end;
7506  __pyx_L3_error:;
7507 
7508  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":944
7509  * try:
7510  * __pyx_import_array()
7511  * except Exception: # <<<<<<<<<<<<<<
7512  * raise ImportError("numpy.core.multiarray failed to import")
7513  *
7514  */
7515  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7516  if (__pyx_t_4) {
7517  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7518  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
7519  __Pyx_GOTREF(__pyx_t_5);
7520  __Pyx_GOTREF(__pyx_t_6);
7521  __Pyx_GOTREF(__pyx_t_7);
7522 
7523  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
7524  * __pyx_import_array()
7525  * except Exception:
7526  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7527  *
7528  * cdef inline int import_umath() except -1:
7529  */
7530  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
7531  __Pyx_GOTREF(__pyx_t_8);
7532  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7533  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7534  __PYX_ERR(2, 945, __pyx_L5_except_error)
7535  }
7536  goto __pyx_L5_except_error;
7537  __pyx_L5_except_error:;
7538 
7539  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":942
7540  * # Cython code.
7541  * cdef inline int import_array() except -1:
7542  * try: # <<<<<<<<<<<<<<
7543  * __pyx_import_array()
7544  * except Exception:
7545  */
7546  __Pyx_XGIVEREF(__pyx_t_1);
7547  __Pyx_XGIVEREF(__pyx_t_2);
7548  __Pyx_XGIVEREF(__pyx_t_3);
7549  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7550  goto __pyx_L1_error;
7551  __pyx_L8_try_end:;
7552  }
7553 
7554  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":941
7555  * # Versions of the import_* functions which are more suitable for
7556  * # Cython code.
7557  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7558  * try:
7559  * __pyx_import_array()
7560  */
7561 
7562  /* function exit code */
7563  __pyx_r = 0;
7564  goto __pyx_L0;
7565  __pyx_L1_error:;
7566  __Pyx_XDECREF(__pyx_t_5);
7567  __Pyx_XDECREF(__pyx_t_6);
7568  __Pyx_XDECREF(__pyx_t_7);
7569  __Pyx_XDECREF(__pyx_t_8);
7570  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7571  __pyx_r = -1;
7572  __pyx_L0:;
7573  __Pyx_RefNannyFinishContext();
7574  return __pyx_r;
7575 }
7576 
7577 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
7578  * raise ImportError("numpy.core.multiarray failed to import")
7579  *
7580  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7581  * try:
7582  * _import_umath()
7583  */
7584 
7585 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7586  int __pyx_r;
7587  __Pyx_RefNannyDeclarations
7588  PyObject *__pyx_t_1 = NULL;
7589  PyObject *__pyx_t_2 = NULL;
7590  PyObject *__pyx_t_3 = NULL;
7591  int __pyx_t_4;
7592  PyObject *__pyx_t_5 = NULL;
7593  PyObject *__pyx_t_6 = NULL;
7594  PyObject *__pyx_t_7 = NULL;
7595  PyObject *__pyx_t_8 = NULL;
7596  int __pyx_lineno = 0;
7597  const char *__pyx_filename = NULL;
7598  int __pyx_clineno = 0;
7599  __Pyx_RefNannySetupContext("import_umath", 0);
7600 
7601  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7602  *
7603  * cdef inline int import_umath() except -1:
7604  * try: # <<<<<<<<<<<<<<
7605  * _import_umath()
7606  * except Exception:
7607  */
7608  {
7609  __Pyx_PyThreadState_declare
7610  __Pyx_PyThreadState_assign
7611  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7612  __Pyx_XGOTREF(__pyx_t_1);
7613  __Pyx_XGOTREF(__pyx_t_2);
7614  __Pyx_XGOTREF(__pyx_t_3);
7615  /*try:*/ {
7616 
7617  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":949
7618  * cdef inline int import_umath() except -1:
7619  * try:
7620  * _import_umath() # <<<<<<<<<<<<<<
7621  * except Exception:
7622  * raise ImportError("numpy.core.umath failed to import")
7623  */
7624  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
7625 
7626  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7627  *
7628  * cdef inline int import_umath() except -1:
7629  * try: # <<<<<<<<<<<<<<
7630  * _import_umath()
7631  * except Exception:
7632  */
7633  }
7634  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7635  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7636  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7637  goto __pyx_L8_try_end;
7638  __pyx_L3_error:;
7639 
7640  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":950
7641  * try:
7642  * _import_umath()
7643  * except Exception: # <<<<<<<<<<<<<<
7644  * raise ImportError("numpy.core.umath failed to import")
7645  *
7646  */
7647  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7648  if (__pyx_t_4) {
7649  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7650  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
7651  __Pyx_GOTREF(__pyx_t_5);
7652  __Pyx_GOTREF(__pyx_t_6);
7653  __Pyx_GOTREF(__pyx_t_7);
7654 
7655  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
7656  * _import_umath()
7657  * except Exception:
7658  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7659  *
7660  * cdef inline int import_ufunc() except -1:
7661  */
7662  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
7663  __Pyx_GOTREF(__pyx_t_8);
7664  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7665  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7666  __PYX_ERR(2, 951, __pyx_L5_except_error)
7667  }
7668  goto __pyx_L5_except_error;
7669  __pyx_L5_except_error:;
7670 
7671  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":948
7672  *
7673  * cdef inline int import_umath() except -1:
7674  * try: # <<<<<<<<<<<<<<
7675  * _import_umath()
7676  * except Exception:
7677  */
7678  __Pyx_XGIVEREF(__pyx_t_1);
7679  __Pyx_XGIVEREF(__pyx_t_2);
7680  __Pyx_XGIVEREF(__pyx_t_3);
7681  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7682  goto __pyx_L1_error;
7683  __pyx_L8_try_end:;
7684  }
7685 
7686  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":947
7687  * raise ImportError("numpy.core.multiarray failed to import")
7688  *
7689  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7690  * try:
7691  * _import_umath()
7692  */
7693 
7694  /* function exit code */
7695  __pyx_r = 0;
7696  goto __pyx_L0;
7697  __pyx_L1_error:;
7698  __Pyx_XDECREF(__pyx_t_5);
7699  __Pyx_XDECREF(__pyx_t_6);
7700  __Pyx_XDECREF(__pyx_t_7);
7701  __Pyx_XDECREF(__pyx_t_8);
7702  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7703  __pyx_r = -1;
7704  __pyx_L0:;
7705  __Pyx_RefNannyFinishContext();
7706  return __pyx_r;
7707 }
7708 
7709 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
7710  * raise ImportError("numpy.core.umath failed to import")
7711  *
7712  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7713  * try:
7714  * _import_umath()
7715  */
7716 
7717 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7718  int __pyx_r;
7719  __Pyx_RefNannyDeclarations
7720  PyObject *__pyx_t_1 = NULL;
7721  PyObject *__pyx_t_2 = NULL;
7722  PyObject *__pyx_t_3 = NULL;
7723  int __pyx_t_4;
7724  PyObject *__pyx_t_5 = NULL;
7725  PyObject *__pyx_t_6 = NULL;
7726  PyObject *__pyx_t_7 = NULL;
7727  PyObject *__pyx_t_8 = NULL;
7728  int __pyx_lineno = 0;
7729  const char *__pyx_filename = NULL;
7730  int __pyx_clineno = 0;
7731  __Pyx_RefNannySetupContext("import_ufunc", 0);
7732 
7733  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
7734  *
7735  * cdef inline int import_ufunc() except -1:
7736  * try: # <<<<<<<<<<<<<<
7737  * _import_umath()
7738  * except Exception:
7739  */
7740  {
7741  __Pyx_PyThreadState_declare
7742  __Pyx_PyThreadState_assign
7743  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7744  __Pyx_XGOTREF(__pyx_t_1);
7745  __Pyx_XGOTREF(__pyx_t_2);
7746  __Pyx_XGOTREF(__pyx_t_3);
7747  /*try:*/ {
7748 
7749  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":955
7750  * cdef inline int import_ufunc() except -1:
7751  * try:
7752  * _import_umath() # <<<<<<<<<<<<<<
7753  * except Exception:
7754  * raise ImportError("numpy.core.umath failed to import")
7755  */
7756  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
7757 
7758  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
7759  *
7760  * cdef inline int import_ufunc() except -1:
7761  * try: # <<<<<<<<<<<<<<
7762  * _import_umath()
7763  * except Exception:
7764  */
7765  }
7766  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7767  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7768  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7769  goto __pyx_L8_try_end;
7770  __pyx_L3_error:;
7771 
7772  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":956
7773  * try:
7774  * _import_umath()
7775  * except Exception: # <<<<<<<<<<<<<<
7776  * raise ImportError("numpy.core.umath failed to import")
7777  *
7778  */
7779  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7780  if (__pyx_t_4) {
7781  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7782  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
7783  __Pyx_GOTREF(__pyx_t_5);
7784  __Pyx_GOTREF(__pyx_t_6);
7785  __Pyx_GOTREF(__pyx_t_7);
7786 
7787  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":957
7788  * _import_umath()
7789  * except Exception:
7790  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7791  *
7792  * cdef extern from *:
7793  */
7794  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
7795  __Pyx_GOTREF(__pyx_t_8);
7796  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7797  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7798  __PYX_ERR(2, 957, __pyx_L5_except_error)
7799  }
7800  goto __pyx_L5_except_error;
7801  __pyx_L5_except_error:;
7802 
7803  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":954
7804  *
7805  * cdef inline int import_ufunc() except -1:
7806  * try: # <<<<<<<<<<<<<<
7807  * _import_umath()
7808  * except Exception:
7809  */
7810  __Pyx_XGIVEREF(__pyx_t_1);
7811  __Pyx_XGIVEREF(__pyx_t_2);
7812  __Pyx_XGIVEREF(__pyx_t_3);
7813  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7814  goto __pyx_L1_error;
7815  __pyx_L8_try_end:;
7816  }
7817 
7818  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":953
7819  * raise ImportError("numpy.core.umath failed to import")
7820  *
7821  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7822  * try:
7823  * _import_umath()
7824  */
7825 
7826  /* function exit code */
7827  __pyx_r = 0;
7828  goto __pyx_L0;
7829  __pyx_L1_error:;
7830  __Pyx_XDECREF(__pyx_t_5);
7831  __Pyx_XDECREF(__pyx_t_6);
7832  __Pyx_XDECREF(__pyx_t_7);
7833  __Pyx_XDECREF(__pyx_t_8);
7834  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7835  __pyx_r = -1;
7836  __pyx_L0:;
7837  __Pyx_RefNannyFinishContext();
7838  return __pyx_r;
7839 }
7840 
7841 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
7842  *
7843  *
7844  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7845  * """
7846  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7847  */
7848 
7849 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7850  int __pyx_r;
7851  __Pyx_RefNannyDeclarations
7852  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
7853 
7854  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":979
7855  * bool
7856  * """
7857  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
7858  *
7859  *
7860  */
7861  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7862  goto __pyx_L0;
7863 
7864  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":967
7865  *
7866  *
7867  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7868  * """
7869  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7870  */
7871 
7872  /* function exit code */
7873  __pyx_L0:;
7874  __Pyx_RefNannyFinishContext();
7875  return __pyx_r;
7876 }
7877 
7878 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
7879  *
7880  *
7881  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7882  * """
7883  * Cython equivalent of `isinstance(obj, np.datetime64)`
7884  */
7885 
7886 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7887  int __pyx_r;
7888  __Pyx_RefNannyDeclarations
7889  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
7890 
7891  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":994
7892  * bool
7893  * """
7894  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
7895  *
7896  *
7897  */
7898  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7899  goto __pyx_L0;
7900 
7901  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":982
7902  *
7903  *
7904  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7905  * """
7906  * Cython equivalent of `isinstance(obj, np.datetime64)`
7907  */
7908 
7909  /* function exit code */
7910  __pyx_L0:;
7911  __Pyx_RefNannyFinishContext();
7912  return __pyx_r;
7913 }
7914 
7915 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
7916  *
7917  *
7918  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7919  * """
7920  * returns the int64 value underlying scalar numpy datetime64 object
7921  */
7922 
7923 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
7924  npy_datetime __pyx_r;
7925 
7926  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1004
7927  * also needed. That can be found using `get_datetime64_unit`.
7928  * """
7929  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
7930  *
7931  *
7932  */
7933  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
7934  goto __pyx_L0;
7935 
7936  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":997
7937  *
7938  *
7939  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7940  * """
7941  * returns the int64 value underlying scalar numpy datetime64 object
7942  */
7943 
7944  /* function exit code */
7945  __pyx_L0:;
7946  return __pyx_r;
7947 }
7948 
7949 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
7950  *
7951  *
7952  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7953  * """
7954  * returns the int64 value underlying scalar numpy timedelta64 object
7955  */
7956 
7957 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7958  npy_timedelta __pyx_r;
7959 
7960  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1011
7961  * returns the int64 value underlying scalar numpy timedelta64 object
7962  * """
7963  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
7964  *
7965  *
7966  */
7967  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7968  goto __pyx_L0;
7969 
7970  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1007
7971  *
7972  *
7973  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7974  * """
7975  * returns the int64 value underlying scalar numpy timedelta64 object
7976  */
7977 
7978  /* function exit code */
7979  __pyx_L0:;
7980  return __pyx_r;
7981 }
7982 
7983 /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
7984  *
7985  *
7986  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7987  * """
7988  * returns the unit part of the dtype for a numpy datetime64 object.
7989  */
7990 
7991 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7992  NPY_DATETIMEUNIT __pyx_r;
7993 
7994  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1018
7995  * returns the unit part of the dtype for a numpy datetime64 object.
7996  * """
7997  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
7998  */
7999  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8000  goto __pyx_L0;
8001 
8002  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":1014
8003  *
8004  *
8005  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8006  * """
8007  * returns the unit part of the dtype for a numpy datetime64 object.
8008  */
8009 
8010  /* function exit code */
8011  __pyx_L0:;
8012  return __pyx_r;
8013 }
8014 
8015 /* "View.MemoryView":122
8016  * cdef bint dtype_is_object
8017  *
8018  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8019  * mode="c", bint allocate_buffer=True):
8020  *
8021  */
8022 
8023 /* Python wrapper */
8024 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8025 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8026  PyObject *__pyx_v_shape = 0;
8027  Py_ssize_t __pyx_v_itemsize;
8028  PyObject *__pyx_v_format = 0;
8029  PyObject *__pyx_v_mode = 0;
8030  int __pyx_v_allocate_buffer;
8031  int __pyx_lineno = 0;
8032  const char *__pyx_filename = NULL;
8033  int __pyx_clineno = 0;
8034  int __pyx_r;
8035  __Pyx_RefNannyDeclarations
8036  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8037  {
8038  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8039  PyObject* values[5] = {0,0,0,0,0};
8040  values[3] = ((PyObject *)__pyx_n_s_c);
8041  if (unlikely(__pyx_kwds)) {
8042  Py_ssize_t kw_args;
8043  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8044  switch (pos_args) {
8045  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8046  CYTHON_FALLTHROUGH;
8047  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8048  CYTHON_FALLTHROUGH;
8049  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8050  CYTHON_FALLTHROUGH;
8051  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8052  CYTHON_FALLTHROUGH;
8053  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8054  CYTHON_FALLTHROUGH;
8055  case 0: break;
8056  default: goto __pyx_L5_argtuple_error;
8057  }
8058  kw_args = PyDict_Size(__pyx_kwds);
8059  switch (pos_args) {
8060  case 0:
8061  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8062  else goto __pyx_L5_argtuple_error;
8063  CYTHON_FALLTHROUGH;
8064  case 1:
8065  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8066  else {
8067  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8068  }
8069  CYTHON_FALLTHROUGH;
8070  case 2:
8071  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8072  else {
8073  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8074  }
8075  CYTHON_FALLTHROUGH;
8076  case 3:
8077  if (kw_args > 0) {
8078  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8079  if (value) { values[3] = value; kw_args--; }
8080  }
8081  CYTHON_FALLTHROUGH;
8082  case 4:
8083  if (kw_args > 0) {
8084  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8085  if (value) { values[4] = value; kw_args--; }
8086  }
8087  }
8088  if (unlikely(kw_args > 0)) {
8089  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8090  }
8091  } else {
8092  switch (PyTuple_GET_SIZE(__pyx_args)) {
8093  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8094  CYTHON_FALLTHROUGH;
8095  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8096  CYTHON_FALLTHROUGH;
8097  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8098  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8099  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8100  break;
8101  default: goto __pyx_L5_argtuple_error;
8102  }
8103  }
8104  __pyx_v_shape = ((PyObject*)values[0]);
8105  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8106  __pyx_v_format = values[2];
8107  __pyx_v_mode = values[3];
8108  if (values[4]) {
8109  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8110  } else {
8111 
8112  /* "View.MemoryView":123
8113  *
8114  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8115  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8116  *
8117  * cdef int idx
8118  */
8119  __pyx_v_allocate_buffer = ((int)1);
8120  }
8121  }
8122  goto __pyx_L4_argument_unpacking_done;
8123  __pyx_L5_argtuple_error:;
8124  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8125  __pyx_L3_error:;
8126  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8127  __Pyx_RefNannyFinishContext();
8128  return -1;
8129  __pyx_L4_argument_unpacking_done:;
8130  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8131  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8132  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
8133  }
8134  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8135 
8136  /* "View.MemoryView":122
8137  * cdef bint dtype_is_object
8138  *
8139  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8140  * mode="c", bint allocate_buffer=True):
8141  *
8142  */
8143 
8144  /* function exit code */
8145  goto __pyx_L0;
8146  __pyx_L1_error:;
8147  __pyx_r = -1;
8148  __pyx_L0:;
8149  __Pyx_RefNannyFinishContext();
8150  return __pyx_r;
8151 }
8152 
8153 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
8154  int __pyx_v_idx;
8155  Py_ssize_t __pyx_v_i;
8156  Py_ssize_t __pyx_v_dim;
8157  PyObject **__pyx_v_p;
8158  char __pyx_v_order;
8159  int __pyx_r;
8160  __Pyx_RefNannyDeclarations
8161  Py_ssize_t __pyx_t_1;
8162  int __pyx_t_2;
8163  PyObject *__pyx_t_3 = NULL;
8164  int __pyx_t_4;
8165  PyObject *__pyx_t_5 = NULL;
8166  PyObject *__pyx_t_6 = NULL;
8167  char *__pyx_t_7;
8168  int __pyx_t_8;
8169  Py_ssize_t __pyx_t_9;
8170  PyObject *__pyx_t_10 = NULL;
8171  Py_ssize_t __pyx_t_11;
8172  int __pyx_lineno = 0;
8173  const char *__pyx_filename = NULL;
8174  int __pyx_clineno = 0;
8175  __Pyx_RefNannySetupContext("__cinit__", 0);
8176  __Pyx_INCREF(__pyx_v_format);
8177 
8178  /* "View.MemoryView":129
8179  * cdef PyObject **p
8180  *
8181  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8182  * self.itemsize = itemsize
8183  *
8184  */
8185  if (unlikely(__pyx_v_shape == Py_None)) {
8186  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8187  __PYX_ERR(1, 129, __pyx_L1_error)
8188  }
8189  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
8190  __pyx_v_self->ndim = ((int)__pyx_t_1);
8191 
8192  /* "View.MemoryView":130
8193  *
8194  * self.ndim = <int> len(shape)
8195  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8196  *
8197  * if not self.ndim:
8198  */
8199  __pyx_v_self->itemsize = __pyx_v_itemsize;
8200 
8201  /* "View.MemoryView":132
8202  * self.itemsize = itemsize
8203  *
8204  * if not self.ndim: # <<<<<<<<<<<<<<
8205  * raise ValueError("Empty shape tuple for cython.array")
8206  *
8207  */
8208  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8209  if (unlikely(__pyx_t_2)) {
8210 
8211  /* "View.MemoryView":133
8212  *
8213  * if not self.ndim:
8214  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8215  *
8216  * if itemsize <= 0:
8217  */
8218  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8219  __Pyx_GOTREF(__pyx_t_3);
8220  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8221  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8222  __PYX_ERR(1, 133, __pyx_L1_error)
8223 
8224  /* "View.MemoryView":132
8225  * self.itemsize = itemsize
8226  *
8227  * if not self.ndim: # <<<<<<<<<<<<<<
8228  * raise ValueError("Empty shape tuple for cython.array")
8229  *
8230  */
8231  }
8232 
8233  /* "View.MemoryView":135
8234  * raise ValueError("Empty shape tuple for cython.array")
8235  *
8236  * if itemsize <= 0: # <<<<<<<<<<<<<<
8237  * raise ValueError("itemsize <= 0 for cython.array")
8238  *
8239  */
8240  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8241  if (unlikely(__pyx_t_2)) {
8242 
8243  /* "View.MemoryView":136
8244  *
8245  * if itemsize <= 0:
8246  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8247  *
8248  * if not isinstance(format, bytes):
8249  */
8250  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8251  __Pyx_GOTREF(__pyx_t_3);
8252  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8253  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8254  __PYX_ERR(1, 136, __pyx_L1_error)
8255 
8256  /* "View.MemoryView":135
8257  * raise ValueError("Empty shape tuple for cython.array")
8258  *
8259  * if itemsize <= 0: # <<<<<<<<<<<<<<
8260  * raise ValueError("itemsize <= 0 for cython.array")
8261  *
8262  */
8263  }
8264 
8265  /* "View.MemoryView":138
8266  * raise ValueError("itemsize <= 0 for cython.array")
8267  *
8268  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8269  * format = format.encode('ASCII')
8270  * self._format = format # keep a reference to the byte string
8271  */
8272  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8273  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8274  if (__pyx_t_4) {
8275 
8276  /* "View.MemoryView":139
8277  *
8278  * if not isinstance(format, bytes):
8279  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8280  * self._format = format # keep a reference to the byte string
8281  * self.format = self._format
8282  */
8283  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8284  __Pyx_GOTREF(__pyx_t_5);
8285  __pyx_t_6 = NULL;
8286  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8287  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8288  if (likely(__pyx_t_6)) {
8289  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8290  __Pyx_INCREF(__pyx_t_6);
8291  __Pyx_INCREF(function);
8292  __Pyx_DECREF_SET(__pyx_t_5, function);
8293  }
8294  }
8295  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
8296  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8297  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8298  __Pyx_GOTREF(__pyx_t_3);
8299  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8300  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8301  __pyx_t_3 = 0;
8302 
8303  /* "View.MemoryView":138
8304  * raise ValueError("itemsize <= 0 for cython.array")
8305  *
8306  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8307  * format = format.encode('ASCII')
8308  * self._format = format # keep a reference to the byte string
8309  */
8310  }
8311 
8312  /* "View.MemoryView":140
8313  * if not isinstance(format, bytes):
8314  * format = format.encode('ASCII')
8315  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8316  * self.format = self._format
8317  *
8318  */
8319  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8320  __pyx_t_3 = __pyx_v_format;
8321  __Pyx_INCREF(__pyx_t_3);
8322  __Pyx_GIVEREF(__pyx_t_3);
8323  __Pyx_GOTREF(__pyx_v_self->_format);
8324  __Pyx_DECREF(__pyx_v_self->_format);
8325  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8326  __pyx_t_3 = 0;
8327 
8328  /* "View.MemoryView":141
8329  * format = format.encode('ASCII')
8330  * self._format = format # keep a reference to the byte string
8331  * self.format = self._format # <<<<<<<<<<<<<<
8332  *
8333  *
8334  */
8335  if (unlikely(__pyx_v_self->_format == Py_None)) {
8336  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8337  __PYX_ERR(1, 141, __pyx_L1_error)
8338  }
8339  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8340  __pyx_v_self->format = __pyx_t_7;
8341 
8342  /* "View.MemoryView":144
8343  *
8344  *
8345  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8346  * self._strides = self._shape + self.ndim
8347  *
8348  */
8349  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8350 
8351  /* "View.MemoryView":145
8352  *
8353  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8354  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8355  *
8356  * if not self._shape:
8357  */
8358  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8359 
8360  /* "View.MemoryView":147
8361  * self._strides = self._shape + self.ndim
8362  *
8363  * if not self._shape: # <<<<<<<<<<<<<<
8364  * raise MemoryError("unable to allocate shape and strides.")
8365  *
8366  */
8367  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8368  if (unlikely(__pyx_t_4)) {
8369 
8370  /* "View.MemoryView":148
8371  *
8372  * if not self._shape:
8373  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8374  *
8375  *
8376  */
8377  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8378  __Pyx_GOTREF(__pyx_t_3);
8379  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8380  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8381  __PYX_ERR(1, 148, __pyx_L1_error)
8382 
8383  /* "View.MemoryView":147
8384  * self._strides = self._shape + self.ndim
8385  *
8386  * if not self._shape: # <<<<<<<<<<<<<<
8387  * raise MemoryError("unable to allocate shape and strides.")
8388  *
8389  */
8390  }
8391 
8392  /* "View.MemoryView":151
8393  *
8394  *
8395  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8396  * if dim <= 0:
8397  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8398  */
8399  __pyx_t_8 = 0;
8400  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8401  for (;;) {
8402  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8403  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8404  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8405  #else
8406  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8407  __Pyx_GOTREF(__pyx_t_5);
8408  #endif
8409  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8410  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8411  __pyx_v_dim = __pyx_t_9;
8412  __pyx_v_idx = __pyx_t_8;
8413  __pyx_t_8 = (__pyx_t_8 + 1);
8414 
8415  /* "View.MemoryView":152
8416  *
8417  * for idx, dim in enumerate(shape):
8418  * if dim <= 0: # <<<<<<<<<<<<<<
8419  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8420  * self._shape[idx] = dim
8421  */
8422  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8423  if (unlikely(__pyx_t_4)) {
8424 
8425  /* "View.MemoryView":153
8426  * for idx, dim in enumerate(shape):
8427  * if dim <= 0:
8428  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8429  * self._shape[idx] = dim
8430  *
8431  */
8432  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8433  __Pyx_GOTREF(__pyx_t_5);
8434  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8435  __Pyx_GOTREF(__pyx_t_6);
8436  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8437  __Pyx_GOTREF(__pyx_t_10);
8438  __Pyx_GIVEREF(__pyx_t_5);
8439  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8440  __Pyx_GIVEREF(__pyx_t_6);
8441  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8442  __pyx_t_5 = 0;
8443  __pyx_t_6 = 0;
8444  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8445  __Pyx_GOTREF(__pyx_t_6);
8446  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8447  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8448  __Pyx_GOTREF(__pyx_t_10);
8449  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8450  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8451  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8452  __PYX_ERR(1, 153, __pyx_L1_error)
8453 
8454  /* "View.MemoryView":152
8455  *
8456  * for idx, dim in enumerate(shape):
8457  * if dim <= 0: # <<<<<<<<<<<<<<
8458  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8459  * self._shape[idx] = dim
8460  */
8461  }
8462 
8463  /* "View.MemoryView":154
8464  * if dim <= 0:
8465  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8466  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8467  *
8468  * cdef char order
8469  */
8470  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8471 
8472  /* "View.MemoryView":151
8473  *
8474  *
8475  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8476  * if dim <= 0:
8477  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8478  */
8479  }
8480  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8481 
8482  /* "View.MemoryView":157
8483  *
8484  * cdef char order
8485  * if mode == 'fortran': # <<<<<<<<<<<<<<
8486  * order = b'F'
8487  * self.mode = u'fortran'
8488  */
8489  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8490  if (__pyx_t_4) {
8491 
8492  /* "View.MemoryView":158
8493  * cdef char order
8494  * if mode == 'fortran':
8495  * order = b'F' # <<<<<<<<<<<<<<
8496  * self.mode = u'fortran'
8497  * elif mode == 'c':
8498  */
8499  __pyx_v_order = 'F';
8500 
8501  /* "View.MemoryView":159
8502  * if mode == 'fortran':
8503  * order = b'F'
8504  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8505  * elif mode == 'c':
8506  * order = b'C'
8507  */
8508  __Pyx_INCREF(__pyx_n_u_fortran);
8509  __Pyx_GIVEREF(__pyx_n_u_fortran);
8510  __Pyx_GOTREF(__pyx_v_self->mode);
8511  __Pyx_DECREF(__pyx_v_self->mode);
8512  __pyx_v_self->mode = __pyx_n_u_fortran;
8513 
8514  /* "View.MemoryView":157
8515  *
8516  * cdef char order
8517  * if mode == 'fortran': # <<<<<<<<<<<<<<
8518  * order = b'F'
8519  * self.mode = u'fortran'
8520  */
8521  goto __pyx_L10;
8522  }
8523 
8524  /* "View.MemoryView":160
8525  * order = b'F'
8526  * self.mode = u'fortran'
8527  * elif mode == 'c': # <<<<<<<<<<<<<<
8528  * order = b'C'
8529  * self.mode = u'c'
8530  */
8531  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8532  if (likely(__pyx_t_4)) {
8533 
8534  /* "View.MemoryView":161
8535  * self.mode = u'fortran'
8536  * elif mode == 'c':
8537  * order = b'C' # <<<<<<<<<<<<<<
8538  * self.mode = u'c'
8539  * else:
8540  */
8541  __pyx_v_order = 'C';
8542 
8543  /* "View.MemoryView":162
8544  * elif mode == 'c':
8545  * order = b'C'
8546  * self.mode = u'c' # <<<<<<<<<<<<<<
8547  * else:
8548  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8549  */
8550  __Pyx_INCREF(__pyx_n_u_c);
8551  __Pyx_GIVEREF(__pyx_n_u_c);
8552  __Pyx_GOTREF(__pyx_v_self->mode);
8553  __Pyx_DECREF(__pyx_v_self->mode);
8554  __pyx_v_self->mode = __pyx_n_u_c;
8555 
8556  /* "View.MemoryView":160
8557  * order = b'F'
8558  * self.mode = u'fortran'
8559  * elif mode == 'c': # <<<<<<<<<<<<<<
8560  * order = b'C'
8561  * self.mode = u'c'
8562  */
8563  goto __pyx_L10;
8564  }
8565 
8566  /* "View.MemoryView":164
8567  * self.mode = u'c'
8568  * else:
8569  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8570  *
8571  * self.len = fill_contig_strides_array(self._shape, self._strides,
8572  */
8573  /*else*/ {
8574  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8575  __Pyx_GOTREF(__pyx_t_3);
8576  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8577  __Pyx_GOTREF(__pyx_t_10);
8578  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8579  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8580  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8581  __PYX_ERR(1, 164, __pyx_L1_error)
8582  }
8583  __pyx_L10:;
8584 
8585  /* "View.MemoryView":166
8586  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8587  *
8588  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8589  * itemsize, self.ndim, order)
8590  *
8591  */
8592  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8593 
8594  /* "View.MemoryView":169
8595  * itemsize, self.ndim, order)
8596  *
8597  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8598  * self.dtype_is_object = format == b'O'
8599  * if allocate_buffer:
8600  */
8601  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8602 
8603  /* "View.MemoryView":170
8604  *
8605  * self.free_data = allocate_buffer
8606  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8607  * if allocate_buffer:
8608  *
8609  */
8610  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8611  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8612  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8613  __pyx_v_self->dtype_is_object = __pyx_t_4;
8614 
8615  /* "View.MemoryView":171
8616  * self.free_data = allocate_buffer
8617  * self.dtype_is_object = format == b'O'
8618  * if allocate_buffer: # <<<<<<<<<<<<<<
8619  *
8620  *
8621  */
8622  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8623  if (__pyx_t_4) {
8624 
8625  /* "View.MemoryView":174
8626  *
8627  *
8628  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8629  * if not self.data:
8630  * raise MemoryError("unable to allocate array data.")
8631  */
8632  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8633 
8634  /* "View.MemoryView":175
8635  *
8636  * self.data = <char *>malloc(self.len)
8637  * if not self.data: # <<<<<<<<<<<<<<
8638  * raise MemoryError("unable to allocate array data.")
8639  *
8640  */
8641  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8642  if (unlikely(__pyx_t_4)) {
8643 
8644  /* "View.MemoryView":176
8645  * self.data = <char *>malloc(self.len)
8646  * if not self.data:
8647  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8648  *
8649  * if self.dtype_is_object:
8650  */
8651  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8652  __Pyx_GOTREF(__pyx_t_10);
8653  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8654  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8655  __PYX_ERR(1, 176, __pyx_L1_error)
8656 
8657  /* "View.MemoryView":175
8658  *
8659  * self.data = <char *>malloc(self.len)
8660  * if not self.data: # <<<<<<<<<<<<<<
8661  * raise MemoryError("unable to allocate array data.")
8662  *
8663  */
8664  }
8665 
8666  /* "View.MemoryView":178
8667  * raise MemoryError("unable to allocate array data.")
8668  *
8669  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8670  * p = <PyObject **> self.data
8671  * for i in range(self.len / itemsize):
8672  */
8673  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8674  if (__pyx_t_4) {
8675 
8676  /* "View.MemoryView":179
8677  *
8678  * if self.dtype_is_object:
8679  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8680  * for i in range(self.len / itemsize):
8681  * p[i] = Py_None
8682  */
8683  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8684 
8685  /* "View.MemoryView":180
8686  * if self.dtype_is_object:
8687  * p = <PyObject **> self.data
8688  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8689  * p[i] = Py_None
8690  * Py_INCREF(Py_None)
8691  */
8692  if (unlikely(__pyx_v_itemsize == 0)) {
8693  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8694  __PYX_ERR(1, 180, __pyx_L1_error)
8695  }
8696  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8697  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8698  __PYX_ERR(1, 180, __pyx_L1_error)
8699  }
8700  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8701  __pyx_t_9 = __pyx_t_1;
8702  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8703  __pyx_v_i = __pyx_t_11;
8704 
8705  /* "View.MemoryView":181
8706  * p = <PyObject **> self.data
8707  * for i in range(self.len / itemsize):
8708  * p[i] = Py_None # <<<<<<<<<<<<<<
8709  * Py_INCREF(Py_None)
8710  *
8711  */
8712  (__pyx_v_p[__pyx_v_i]) = Py_None;
8713 
8714  /* "View.MemoryView":182
8715  * for i in range(self.len / itemsize):
8716  * p[i] = Py_None
8717  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8718  *
8719  * @cname('getbuffer')
8720  */
8721  Py_INCREF(Py_None);
8722  }
8723 
8724  /* "View.MemoryView":178
8725  * raise MemoryError("unable to allocate array data.")
8726  *
8727  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8728  * p = <PyObject **> self.data
8729  * for i in range(self.len / itemsize):
8730  */
8731  }
8732 
8733  /* "View.MemoryView":171
8734  * self.free_data = allocate_buffer
8735  * self.dtype_is_object = format == b'O'
8736  * if allocate_buffer: # <<<<<<<<<<<<<<
8737  *
8738  *
8739  */
8740  }
8741 
8742  /* "View.MemoryView":122
8743  * cdef bint dtype_is_object
8744  *
8745  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8746  * mode="c", bint allocate_buffer=True):
8747  *
8748  */
8749 
8750  /* function exit code */
8751  __pyx_r = 0;
8752  goto __pyx_L0;
8753  __pyx_L1_error:;
8754  __Pyx_XDECREF(__pyx_t_3);
8755  __Pyx_XDECREF(__pyx_t_5);
8756  __Pyx_XDECREF(__pyx_t_6);
8757  __Pyx_XDECREF(__pyx_t_10);
8758  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8759  __pyx_r = -1;
8760  __pyx_L0:;
8761  __Pyx_XDECREF(__pyx_v_format);
8762  __Pyx_RefNannyFinishContext();
8763  return __pyx_r;
8764 }
8765 
8766 /* "View.MemoryView":185
8767  *
8768  * @cname('getbuffer')
8769  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8770  * cdef int bufmode = -1
8771  * if self.mode == u"c":
8772  */
8773 
8774 /* Python wrapper */
8775 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8776 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8777  int __pyx_r;
8778  __Pyx_RefNannyDeclarations
8779  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8780  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
8781 
8782  /* function exit code */
8783  __Pyx_RefNannyFinishContext();
8784  return __pyx_r;
8785 }
8786 
8787 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8788  int __pyx_v_bufmode;
8789  int __pyx_r;
8790  __Pyx_RefNannyDeclarations
8791  int __pyx_t_1;
8792  int __pyx_t_2;
8793  PyObject *__pyx_t_3 = NULL;
8794  char *__pyx_t_4;
8795  Py_ssize_t __pyx_t_5;
8796  int __pyx_t_6;
8797  Py_ssize_t *__pyx_t_7;
8798  int __pyx_lineno = 0;
8799  const char *__pyx_filename = NULL;
8800  int __pyx_clineno = 0;
8801  if (__pyx_v_info == NULL) {
8802  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8803  return -1;
8804  }
8805  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8806  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8807  __Pyx_GIVEREF(__pyx_v_info->obj);
8808 
8809  /* "View.MemoryView":186
8810  * @cname('getbuffer')
8811  * def __getbuffer__(self, Py_buffer *info, int flags):
8812  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8813  * if self.mode == u"c":
8814  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8815  */
8816  __pyx_v_bufmode = -1;
8817 
8818  /* "View.MemoryView":187
8819  * def __getbuffer__(self, Py_buffer *info, int flags):
8820  * cdef int bufmode = -1
8821  * if self.mode == u"c": # <<<<<<<<<<<<<<
8822  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8823  * elif self.mode == u"fortran":
8824  */
8825  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8826  __pyx_t_2 = (__pyx_t_1 != 0);
8827  if (__pyx_t_2) {
8828 
8829  /* "View.MemoryView":188
8830  * cdef int bufmode = -1
8831  * if self.mode == u"c":
8832  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8833  * elif self.mode == u"fortran":
8834  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8835  */
8836  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8837 
8838  /* "View.MemoryView":187
8839  * def __getbuffer__(self, Py_buffer *info, int flags):
8840  * cdef int bufmode = -1
8841  * if self.mode == u"c": # <<<<<<<<<<<<<<
8842  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8843  * elif self.mode == u"fortran":
8844  */
8845  goto __pyx_L3;
8846  }
8847 
8848  /* "View.MemoryView":189
8849  * if self.mode == u"c":
8850  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8851  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8852  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8853  * if not (flags & bufmode):
8854  */
8855  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8856  __pyx_t_1 = (__pyx_t_2 != 0);
8857  if (__pyx_t_1) {
8858 
8859  /* "View.MemoryView":190
8860  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8861  * elif self.mode == u"fortran":
8862  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8863  * if not (flags & bufmode):
8864  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8865  */
8866  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8867 
8868  /* "View.MemoryView":189
8869  * if self.mode == u"c":
8870  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8871  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8872  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8873  * if not (flags & bufmode):
8874  */
8875  }
8876  __pyx_L3:;
8877 
8878  /* "View.MemoryView":191
8879  * elif self.mode == u"fortran":
8880  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8881  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8882  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8883  * info.buf = self.data
8884  */
8885  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8886  if (unlikely(__pyx_t_1)) {
8887 
8888  /* "View.MemoryView":192
8889  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8890  * if not (flags & bufmode):
8891  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8892  * info.buf = self.data
8893  * info.len = self.len
8894  */
8895  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8896  __Pyx_GOTREF(__pyx_t_3);
8897  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8898  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8899  __PYX_ERR(1, 192, __pyx_L1_error)
8900 
8901  /* "View.MemoryView":191
8902  * elif self.mode == u"fortran":
8903  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8904  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8905  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8906  * info.buf = self.data
8907  */
8908  }
8909 
8910  /* "View.MemoryView":193
8911  * if not (flags & bufmode):
8912  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8913  * info.buf = self.data # <<<<<<<<<<<<<<
8914  * info.len = self.len
8915  * info.ndim = self.ndim
8916  */
8917  __pyx_t_4 = __pyx_v_self->data;
8918  __pyx_v_info->buf = __pyx_t_4;
8919 
8920  /* "View.MemoryView":194
8921  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8922  * info.buf = self.data
8923  * info.len = self.len # <<<<<<<<<<<<<<
8924  * info.ndim = self.ndim
8925  * info.shape = self._shape
8926  */
8927  __pyx_t_5 = __pyx_v_self->len;
8928  __pyx_v_info->len = __pyx_t_5;
8929 
8930  /* "View.MemoryView":195
8931  * info.buf = self.data
8932  * info.len = self.len
8933  * info.ndim = self.ndim # <<<<<<<<<<<<<<
8934  * info.shape = self._shape
8935  * info.strides = self._strides
8936  */
8937  __pyx_t_6 = __pyx_v_self->ndim;
8938  __pyx_v_info->ndim = __pyx_t_6;
8939 
8940  /* "View.MemoryView":196
8941  * info.len = self.len
8942  * info.ndim = self.ndim
8943  * info.shape = self._shape # <<<<<<<<<<<<<<
8944  * info.strides = self._strides
8945  * info.suboffsets = NULL
8946  */
8947  __pyx_t_7 = __pyx_v_self->_shape;
8948  __pyx_v_info->shape = __pyx_t_7;
8949 
8950  /* "View.MemoryView":197
8951  * info.ndim = self.ndim
8952  * info.shape = self._shape
8953  * info.strides = self._strides # <<<<<<<<<<<<<<
8954  * info.suboffsets = NULL
8955  * info.itemsize = self.itemsize
8956  */
8957  __pyx_t_7 = __pyx_v_self->_strides;
8958  __pyx_v_info->strides = __pyx_t_7;
8959 
8960  /* "View.MemoryView":198
8961  * info.shape = self._shape
8962  * info.strides = self._strides
8963  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8964  * info.itemsize = self.itemsize
8965  * info.readonly = 0
8966  */
8967  __pyx_v_info->suboffsets = NULL;
8968 
8969  /* "View.MemoryView":199
8970  * info.strides = self._strides
8971  * info.suboffsets = NULL
8972  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8973  * info.readonly = 0
8974  *
8975  */
8976  __pyx_t_5 = __pyx_v_self->itemsize;
8977  __pyx_v_info->itemsize = __pyx_t_5;
8978 
8979  /* "View.MemoryView":200
8980  * info.suboffsets = NULL
8981  * info.itemsize = self.itemsize
8982  * info.readonly = 0 # <<<<<<<<<<<<<<
8983  *
8984  * if flags & PyBUF_FORMAT:
8985  */
8986  __pyx_v_info->readonly = 0;
8987 
8988  /* "View.MemoryView":202
8989  * info.readonly = 0
8990  *
8991  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8992  * info.format = self.format
8993  * else:
8994  */
8995  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8996  if (__pyx_t_1) {
8997 
8998  /* "View.MemoryView":203
8999  *
9000  * if flags & PyBUF_FORMAT:
9001  * info.format = self.format # <<<<<<<<<<<<<<
9002  * else:
9003  * info.format = NULL
9004  */
9005  __pyx_t_4 = __pyx_v_self->format;
9006  __pyx_v_info->format = __pyx_t_4;
9007 
9008  /* "View.MemoryView":202
9009  * info.readonly = 0
9010  *
9011  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9012  * info.format = self.format
9013  * else:
9014  */
9015  goto __pyx_L5;
9016  }
9017 
9018  /* "View.MemoryView":205
9019  * info.format = self.format
9020  * else:
9021  * info.format = NULL # <<<<<<<<<<<<<<
9022  *
9023  * info.obj = self
9024  */
9025  /*else*/ {
9026  __pyx_v_info->format = NULL;
9027  }
9028  __pyx_L5:;
9029 
9030  /* "View.MemoryView":207
9031  * info.format = NULL
9032  *
9033  * info.obj = self # <<<<<<<<<<<<<<
9034  *
9035  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9036  */
9037  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9038  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9039  __Pyx_GOTREF(__pyx_v_info->obj);
9040  __Pyx_DECREF(__pyx_v_info->obj);
9041  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9042 
9043  /* "View.MemoryView":185
9044  *
9045  * @cname('getbuffer')
9046  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9047  * cdef int bufmode = -1
9048  * if self.mode == u"c":
9049  */
9050 
9051  /* function exit code */
9052  __pyx_r = 0;
9053  goto __pyx_L0;
9054  __pyx_L1_error:;
9055  __Pyx_XDECREF(__pyx_t_3);
9056  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9057  __pyx_r = -1;
9058  if (__pyx_v_info->obj != NULL) {
9059  __Pyx_GOTREF(__pyx_v_info->obj);
9060  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9061  }
9062  goto __pyx_L2;
9063  __pyx_L0:;
9064  if (__pyx_v_info->obj == Py_None) {
9065  __Pyx_GOTREF(__pyx_v_info->obj);
9066  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9067  }
9068  __pyx_L2:;
9069  __Pyx_RefNannyFinishContext();
9070  return __pyx_r;
9071 }
9072 
9073 /* "View.MemoryView":211
9074  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9075  *
9076  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9077  * if self.callback_free_data != NULL:
9078  * self.callback_free_data(self.data)
9079  */
9080 
9081 /* Python wrapper */
9082 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9083 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9084  __Pyx_RefNannyDeclarations
9085  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9086  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9087 
9088  /* function exit code */
9089  __Pyx_RefNannyFinishContext();
9090 }
9091 
9092 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9093  __Pyx_RefNannyDeclarations
9094  int __pyx_t_1;
9095  __Pyx_RefNannySetupContext("__dealloc__", 0);
9096 
9097  /* "View.MemoryView":212
9098  *
9099  * def __dealloc__(array self):
9100  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9101  * self.callback_free_data(self.data)
9102  * elif self.free_data:
9103  */
9104  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9105  if (__pyx_t_1) {
9106 
9107  /* "View.MemoryView":213
9108  * def __dealloc__(array self):
9109  * if self.callback_free_data != NULL:
9110  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9111  * elif self.free_data:
9112  * if self.dtype_is_object:
9113  */
9114  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9115 
9116  /* "View.MemoryView":212
9117  *
9118  * def __dealloc__(array self):
9119  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9120  * self.callback_free_data(self.data)
9121  * elif self.free_data:
9122  */
9123  goto __pyx_L3;
9124  }
9125 
9126  /* "View.MemoryView":214
9127  * if self.callback_free_data != NULL:
9128  * self.callback_free_data(self.data)
9129  * elif self.free_data: # <<<<<<<<<<<<<<
9130  * if self.dtype_is_object:
9131  * refcount_objects_in_slice(self.data, self._shape,
9132  */
9133  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9134  if (__pyx_t_1) {
9135 
9136  /* "View.MemoryView":215
9137  * self.callback_free_data(self.data)
9138  * elif self.free_data:
9139  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9140  * refcount_objects_in_slice(self.data, self._shape,
9141  * self._strides, self.ndim, False)
9142  */
9143  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9144  if (__pyx_t_1) {
9145 
9146  /* "View.MemoryView":216
9147  * elif self.free_data:
9148  * if self.dtype_is_object:
9149  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9150  * self._strides, self.ndim, False)
9151  * free(self.data)
9152  */
9153  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9154 
9155  /* "View.MemoryView":215
9156  * self.callback_free_data(self.data)
9157  * elif self.free_data:
9158  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9159  * refcount_objects_in_slice(self.data, self._shape,
9160  * self._strides, self.ndim, False)
9161  */
9162  }
9163 
9164  /* "View.MemoryView":218
9165  * refcount_objects_in_slice(self.data, self._shape,
9166  * self._strides, self.ndim, False)
9167  * free(self.data) # <<<<<<<<<<<<<<
9168  * PyObject_Free(self._shape)
9169  *
9170  */
9171  free(__pyx_v_self->data);
9172 
9173  /* "View.MemoryView":214
9174  * if self.callback_free_data != NULL:
9175  * self.callback_free_data(self.data)
9176  * elif self.free_data: # <<<<<<<<<<<<<<
9177  * if self.dtype_is_object:
9178  * refcount_objects_in_slice(self.data, self._shape,
9179  */
9180  }
9181  __pyx_L3:;
9182 
9183  /* "View.MemoryView":219
9184  * self._strides, self.ndim, False)
9185  * free(self.data)
9186  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9187  *
9188  * @property
9189  */
9190  PyObject_Free(__pyx_v_self->_shape);
9191 
9192  /* "View.MemoryView":211
9193  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9194  *
9195  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9196  * if self.callback_free_data != NULL:
9197  * self.callback_free_data(self.data)
9198  */
9199 
9200  /* function exit code */
9201  __Pyx_RefNannyFinishContext();
9202 }
9203 
9204 /* "View.MemoryView":222
9205  *
9206  * @property
9207  * def memview(self): # <<<<<<<<<<<<<<
9208  * return self.get_memview()
9209  *
9210  */
9211 
9212 /* Python wrapper */
9213 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9214 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9215  PyObject *__pyx_r = 0;
9216  __Pyx_RefNannyDeclarations
9217  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9218  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9219 
9220  /* function exit code */
9221  __Pyx_RefNannyFinishContext();
9222  return __pyx_r;
9223 }
9224 
9225 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9226  PyObject *__pyx_r = NULL;
9227  __Pyx_RefNannyDeclarations
9228  PyObject *__pyx_t_1 = NULL;
9229  int __pyx_lineno = 0;
9230  const char *__pyx_filename = NULL;
9231  int __pyx_clineno = 0;
9232  __Pyx_RefNannySetupContext("__get__", 0);
9233 
9234  /* "View.MemoryView":223
9235  * @property
9236  * def memview(self):
9237  * return self.get_memview() # <<<<<<<<<<<<<<
9238  *
9239  * @cname('get_memview')
9240  */
9241  __Pyx_XDECREF(__pyx_r);
9242  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9243  __Pyx_GOTREF(__pyx_t_1);
9244  __pyx_r = __pyx_t_1;
9245  __pyx_t_1 = 0;
9246  goto __pyx_L0;
9247 
9248  /* "View.MemoryView":222
9249  *
9250  * @property
9251  * def memview(self): # <<<<<<<<<<<<<<
9252  * return self.get_memview()
9253  *
9254  */
9255 
9256  /* function exit code */
9257  __pyx_L1_error:;
9258  __Pyx_XDECREF(__pyx_t_1);
9259  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9260  __pyx_r = NULL;
9261  __pyx_L0:;
9262  __Pyx_XGIVEREF(__pyx_r);
9263  __Pyx_RefNannyFinishContext();
9264  return __pyx_r;
9265 }
9266 
9267 /* "View.MemoryView":226
9268  *
9269  * @cname('get_memview')
9270  * cdef get_memview(self): # <<<<<<<<<<<<<<
9271  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9272  * return memoryview(self, flags, self.dtype_is_object)
9273  */
9274 
9275 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9276  int __pyx_v_flags;
9277  PyObject *__pyx_r = NULL;
9278  __Pyx_RefNannyDeclarations
9279  PyObject *__pyx_t_1 = NULL;
9280  PyObject *__pyx_t_2 = NULL;
9281  PyObject *__pyx_t_3 = NULL;
9282  int __pyx_lineno = 0;
9283  const char *__pyx_filename = NULL;
9284  int __pyx_clineno = 0;
9285  __Pyx_RefNannySetupContext("get_memview", 0);
9286 
9287  /* "View.MemoryView":227
9288  * @cname('get_memview')
9289  * cdef get_memview(self):
9290  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9291  * return memoryview(self, flags, self.dtype_is_object)
9292  *
9293  */
9294  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9295 
9296  /* "View.MemoryView":228
9297  * cdef get_memview(self):
9298  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9299  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9300  *
9301  * def __len__(self):
9302  */
9303  __Pyx_XDECREF(__pyx_r);
9304  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9305  __Pyx_GOTREF(__pyx_t_1);
9306  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9307  __Pyx_GOTREF(__pyx_t_2);
9308  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9309  __Pyx_GOTREF(__pyx_t_3);
9310  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9311  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9312  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9313  __Pyx_GIVEREF(__pyx_t_1);
9314  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9315  __Pyx_GIVEREF(__pyx_t_2);
9316  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9317  __pyx_t_1 = 0;
9318  __pyx_t_2 = 0;
9319  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9320  __Pyx_GOTREF(__pyx_t_2);
9321  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9322  __pyx_r = __pyx_t_2;
9323  __pyx_t_2 = 0;
9324  goto __pyx_L0;
9325 
9326  /* "View.MemoryView":226
9327  *
9328  * @cname('get_memview')
9329  * cdef get_memview(self): # <<<<<<<<<<<<<<
9330  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9331  * return memoryview(self, flags, self.dtype_is_object)
9332  */
9333 
9334  /* function exit code */
9335  __pyx_L1_error:;
9336  __Pyx_XDECREF(__pyx_t_1);
9337  __Pyx_XDECREF(__pyx_t_2);
9338  __Pyx_XDECREF(__pyx_t_3);
9339  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9340  __pyx_r = 0;
9341  __pyx_L0:;
9342  __Pyx_XGIVEREF(__pyx_r);
9343  __Pyx_RefNannyFinishContext();
9344  return __pyx_r;
9345 }
9346 
9347 /* "View.MemoryView":230
9348  * return memoryview(self, flags, self.dtype_is_object)
9349  *
9350  * def __len__(self): # <<<<<<<<<<<<<<
9351  * return self._shape[0]
9352  *
9353  */
9354 
9355 /* Python wrapper */
9356 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9357 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9358  Py_ssize_t __pyx_r;
9359  __Pyx_RefNannyDeclarations
9360  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9361  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9362 
9363  /* function exit code */
9364  __Pyx_RefNannyFinishContext();
9365  return __pyx_r;
9366 }
9367 
9368 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9369  Py_ssize_t __pyx_r;
9370  __Pyx_RefNannyDeclarations
9371  __Pyx_RefNannySetupContext("__len__", 0);
9372 
9373  /* "View.MemoryView":231
9374  *
9375  * def __len__(self):
9376  * return self._shape[0] # <<<<<<<<<<<<<<
9377  *
9378  * def __getattr__(self, attr):
9379  */
9380  __pyx_r = (__pyx_v_self->_shape[0]);
9381  goto __pyx_L0;
9382 
9383  /* "View.MemoryView":230
9384  * return memoryview(self, flags, self.dtype_is_object)
9385  *
9386  * def __len__(self): # <<<<<<<<<<<<<<
9387  * return self._shape[0]
9388  *
9389  */
9390 
9391  /* function exit code */
9392  __pyx_L0:;
9393  __Pyx_RefNannyFinishContext();
9394  return __pyx_r;
9395 }
9396 
9397 /* "View.MemoryView":233
9398  * return self._shape[0]
9399  *
9400  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9401  * return getattr(self.memview, attr)
9402  *
9403  */
9404 
9405 /* Python wrapper */
9406 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9407 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9408  PyObject *__pyx_r = 0;
9409  __Pyx_RefNannyDeclarations
9410  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9411  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9412 
9413  /* function exit code */
9414  __Pyx_RefNannyFinishContext();
9415  return __pyx_r;
9416 }
9417 
9418 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9419  PyObject *__pyx_r = NULL;
9420  __Pyx_RefNannyDeclarations
9421  PyObject *__pyx_t_1 = NULL;
9422  PyObject *__pyx_t_2 = NULL;
9423  int __pyx_lineno = 0;
9424  const char *__pyx_filename = NULL;
9425  int __pyx_clineno = 0;
9426  __Pyx_RefNannySetupContext("__getattr__", 0);
9427 
9428  /* "View.MemoryView":234
9429  *
9430  * def __getattr__(self, attr):
9431  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9432  *
9433  * def __getitem__(self, item):
9434  */
9435  __Pyx_XDECREF(__pyx_r);
9436  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9437  __Pyx_GOTREF(__pyx_t_1);
9438  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9439  __Pyx_GOTREF(__pyx_t_2);
9440  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9441  __pyx_r = __pyx_t_2;
9442  __pyx_t_2 = 0;
9443  goto __pyx_L0;
9444 
9445  /* "View.MemoryView":233
9446  * return self._shape[0]
9447  *
9448  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9449  * return getattr(self.memview, attr)
9450  *
9451  */
9452 
9453  /* function exit code */
9454  __pyx_L1_error:;
9455  __Pyx_XDECREF(__pyx_t_1);
9456  __Pyx_XDECREF(__pyx_t_2);
9457  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9458  __pyx_r = NULL;
9459  __pyx_L0:;
9460  __Pyx_XGIVEREF(__pyx_r);
9461  __Pyx_RefNannyFinishContext();
9462  return __pyx_r;
9463 }
9464 
9465 /* "View.MemoryView":236
9466  * return getattr(self.memview, attr)
9467  *
9468  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9469  * return self.memview[item]
9470  *
9471  */
9472 
9473 /* Python wrapper */
9474 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9475 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9476  PyObject *__pyx_r = 0;
9477  __Pyx_RefNannyDeclarations
9478  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9479  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9480 
9481  /* function exit code */
9482  __Pyx_RefNannyFinishContext();
9483  return __pyx_r;
9484 }
9485 
9486 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9487  PyObject *__pyx_r = NULL;
9488  __Pyx_RefNannyDeclarations
9489  PyObject *__pyx_t_1 = NULL;
9490  PyObject *__pyx_t_2 = NULL;
9491  int __pyx_lineno = 0;
9492  const char *__pyx_filename = NULL;
9493  int __pyx_clineno = 0;
9494  __Pyx_RefNannySetupContext("__getitem__", 0);
9495 
9496  /* "View.MemoryView":237
9497  *
9498  * def __getitem__(self, item):
9499  * return self.memview[item] # <<<<<<<<<<<<<<
9500  *
9501  * def __setitem__(self, item, value):
9502  */
9503  __Pyx_XDECREF(__pyx_r);
9504  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9505  __Pyx_GOTREF(__pyx_t_1);
9506  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9507  __Pyx_GOTREF(__pyx_t_2);
9508  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9509  __pyx_r = __pyx_t_2;
9510  __pyx_t_2 = 0;
9511  goto __pyx_L0;
9512 
9513  /* "View.MemoryView":236
9514  * return getattr(self.memview, attr)
9515  *
9516  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9517  * return self.memview[item]
9518  *
9519  */
9520 
9521  /* function exit code */
9522  __pyx_L1_error:;
9523  __Pyx_XDECREF(__pyx_t_1);
9524  __Pyx_XDECREF(__pyx_t_2);
9525  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9526  __pyx_r = NULL;
9527  __pyx_L0:;
9528  __Pyx_XGIVEREF(__pyx_r);
9529  __Pyx_RefNannyFinishContext();
9530  return __pyx_r;
9531 }
9532 
9533 /* "View.MemoryView":239
9534  * return self.memview[item]
9535  *
9536  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9537  * self.memview[item] = value
9538  *
9539  */
9540 
9541 /* Python wrapper */
9542 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9543 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9544  int __pyx_r;
9545  __Pyx_RefNannyDeclarations
9546  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9547  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9548 
9549  /* function exit code */
9550  __Pyx_RefNannyFinishContext();
9551  return __pyx_r;
9552 }
9553 
9554 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9555  int __pyx_r;
9556  __Pyx_RefNannyDeclarations
9557  PyObject *__pyx_t_1 = NULL;
9558  int __pyx_lineno = 0;
9559  const char *__pyx_filename = NULL;
9560  int __pyx_clineno = 0;
9561  __Pyx_RefNannySetupContext("__setitem__", 0);
9562 
9563  /* "View.MemoryView":240
9564  *
9565  * def __setitem__(self, item, value):
9566  * self.memview[item] = value # <<<<<<<<<<<<<<
9567  *
9568  *
9569  */
9570  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9571  __Pyx_GOTREF(__pyx_t_1);
9572  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9573  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9574 
9575  /* "View.MemoryView":239
9576  * return self.memview[item]
9577  *
9578  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9579  * self.memview[item] = value
9580  *
9581  */
9582 
9583  /* function exit code */
9584  __pyx_r = 0;
9585  goto __pyx_L0;
9586  __pyx_L1_error:;
9587  __Pyx_XDECREF(__pyx_t_1);
9588  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9589  __pyx_r = -1;
9590  __pyx_L0:;
9591  __Pyx_RefNannyFinishContext();
9592  return __pyx_r;
9593 }
9594 
9595 /* "(tree fragment)":1
9596  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9597  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9598  * def __setstate_cython__(self, __pyx_state):
9599  */
9600 
9601 /* Python wrapper */
9602 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9603 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9604  PyObject *__pyx_r = 0;
9605  __Pyx_RefNannyDeclarations
9606  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9607  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9608 
9609  /* function exit code */
9610  __Pyx_RefNannyFinishContext();
9611  return __pyx_r;
9612 }
9613 
9614 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9615  PyObject *__pyx_r = NULL;
9616  __Pyx_RefNannyDeclarations
9617  PyObject *__pyx_t_1 = NULL;
9618  int __pyx_lineno = 0;
9619  const char *__pyx_filename = NULL;
9620  int __pyx_clineno = 0;
9621  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9622 
9623  /* "(tree fragment)":2
9624  * def __reduce_cython__(self):
9625  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9626  * def __setstate_cython__(self, __pyx_state):
9627  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9628  */
9629  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9630  __Pyx_GOTREF(__pyx_t_1);
9631  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9632  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9633  __PYX_ERR(1, 2, __pyx_L1_error)
9634 
9635  /* "(tree fragment)":1
9636  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9637  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9638  * def __setstate_cython__(self, __pyx_state):
9639  */
9640 
9641  /* function exit code */
9642  __pyx_L1_error:;
9643  __Pyx_XDECREF(__pyx_t_1);
9644  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9645  __pyx_r = NULL;
9646  __Pyx_XGIVEREF(__pyx_r);
9647  __Pyx_RefNannyFinishContext();
9648  return __pyx_r;
9649 }
9650 
9651 /* "(tree fragment)":3
9652  * def __reduce_cython__(self):
9653  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9654  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9655  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9656  */
9657 
9658 /* Python wrapper */
9659 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9660 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9661  PyObject *__pyx_r = 0;
9662  __Pyx_RefNannyDeclarations
9663  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9664  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9665 
9666  /* function exit code */
9667  __Pyx_RefNannyFinishContext();
9668  return __pyx_r;
9669 }
9670 
9671 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9672  PyObject *__pyx_r = NULL;
9673  __Pyx_RefNannyDeclarations
9674  PyObject *__pyx_t_1 = NULL;
9675  int __pyx_lineno = 0;
9676  const char *__pyx_filename = NULL;
9677  int __pyx_clineno = 0;
9678  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9679 
9680  /* "(tree fragment)":4
9681  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9682  * def __setstate_cython__(self, __pyx_state):
9683  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9684  */
9685  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9686  __Pyx_GOTREF(__pyx_t_1);
9687  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9688  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9689  __PYX_ERR(1, 4, __pyx_L1_error)
9690 
9691  /* "(tree fragment)":3
9692  * def __reduce_cython__(self):
9693  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9694  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9695  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9696  */
9697 
9698  /* function exit code */
9699  __pyx_L1_error:;
9700  __Pyx_XDECREF(__pyx_t_1);
9701  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9702  __pyx_r = NULL;
9703  __Pyx_XGIVEREF(__pyx_r);
9704  __Pyx_RefNannyFinishContext();
9705  return __pyx_r;
9706 }
9707 
9708 /* "View.MemoryView":244
9709  *
9710  * @cname("__pyx_array_new")
9711  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9712  * char *mode, char *buf):
9713  * cdef array result
9714  */
9715 
9716 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9717  struct __pyx_array_obj *__pyx_v_result = 0;
9718  struct __pyx_array_obj *__pyx_r = NULL;
9719  __Pyx_RefNannyDeclarations
9720  int __pyx_t_1;
9721  PyObject *__pyx_t_2 = NULL;
9722  PyObject *__pyx_t_3 = NULL;
9723  PyObject *__pyx_t_4 = NULL;
9724  PyObject *__pyx_t_5 = NULL;
9725  int __pyx_lineno = 0;
9726  const char *__pyx_filename = NULL;
9727  int __pyx_clineno = 0;
9728  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9729 
9730  /* "View.MemoryView":248
9731  * cdef array result
9732  *
9733  * if buf == NULL: # <<<<<<<<<<<<<<
9734  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9735  * else:
9736  */
9737  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9738  if (__pyx_t_1) {
9739 
9740  /* "View.MemoryView":249
9741  *
9742  * if buf == NULL:
9743  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9744  * else:
9745  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9746  */
9747  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9748  __Pyx_GOTREF(__pyx_t_2);
9749  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9750  __Pyx_GOTREF(__pyx_t_3);
9751  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9752  __Pyx_GOTREF(__pyx_t_4);
9753  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9754  __Pyx_GOTREF(__pyx_t_5);
9755  __Pyx_INCREF(__pyx_v_shape);
9756  __Pyx_GIVEREF(__pyx_v_shape);
9757  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9758  __Pyx_GIVEREF(__pyx_t_2);
9759  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9760  __Pyx_GIVEREF(__pyx_t_3);
9761  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9762  __Pyx_GIVEREF(__pyx_t_4);
9763  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9764  __pyx_t_2 = 0;
9765  __pyx_t_3 = 0;
9766  __pyx_t_4 = 0;
9767  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9768  __Pyx_GOTREF(__pyx_t_4);
9769  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9770  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9771  __pyx_t_4 = 0;
9772 
9773  /* "View.MemoryView":248
9774  * cdef array result
9775  *
9776  * if buf == NULL: # <<<<<<<<<<<<<<
9777  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9778  * else:
9779  */
9780  goto __pyx_L3;
9781  }
9782 
9783  /* "View.MemoryView":251
9784  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9785  * else:
9786  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9787  * allocate_buffer=False)
9788  * result.data = buf
9789  */
9790  /*else*/ {
9791  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9792  __Pyx_GOTREF(__pyx_t_4);
9793  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9794  __Pyx_GOTREF(__pyx_t_5);
9795  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9796  __Pyx_GOTREF(__pyx_t_3);
9797  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9798  __Pyx_GOTREF(__pyx_t_2);
9799  __Pyx_INCREF(__pyx_v_shape);
9800  __Pyx_GIVEREF(__pyx_v_shape);
9801  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9802  __Pyx_GIVEREF(__pyx_t_4);
9803  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9804  __Pyx_GIVEREF(__pyx_t_5);
9805  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9806  __Pyx_GIVEREF(__pyx_t_3);
9807  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9808  __pyx_t_4 = 0;
9809  __pyx_t_5 = 0;
9810  __pyx_t_3 = 0;
9811 
9812  /* "View.MemoryView":252
9813  * else:
9814  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9815  * allocate_buffer=False) # <<<<<<<<<<<<<<
9816  * result.data = buf
9817  *
9818  */
9819  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9820  __Pyx_GOTREF(__pyx_t_3);
9821  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9822 
9823  /* "View.MemoryView":251
9824  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9825  * else:
9826  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9827  * allocate_buffer=False)
9828  * result.data = buf
9829  */
9830  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9831  __Pyx_GOTREF(__pyx_t_5);
9832  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9833  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9834  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9835  __pyx_t_5 = 0;
9836 
9837  /* "View.MemoryView":253
9838  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9839  * allocate_buffer=False)
9840  * result.data = buf # <<<<<<<<<<<<<<
9841  *
9842  * return result
9843  */
9844  __pyx_v_result->data = __pyx_v_buf;
9845  }
9846  __pyx_L3:;
9847 
9848  /* "View.MemoryView":255
9849  * result.data = buf
9850  *
9851  * return result # <<<<<<<<<<<<<<
9852  *
9853  *
9854  */
9855  __Pyx_XDECREF(((PyObject *)__pyx_r));
9856  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9857  __pyx_r = __pyx_v_result;
9858  goto __pyx_L0;
9859 
9860  /* "View.MemoryView":244
9861  *
9862  * @cname("__pyx_array_new")
9863  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9864  * char *mode, char *buf):
9865  * cdef array result
9866  */
9867 
9868  /* function exit code */
9869  __pyx_L1_error:;
9870  __Pyx_XDECREF(__pyx_t_2);
9871  __Pyx_XDECREF(__pyx_t_3);
9872  __Pyx_XDECREF(__pyx_t_4);
9873  __Pyx_XDECREF(__pyx_t_5);
9874  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9875  __pyx_r = 0;
9876  __pyx_L0:;
9877  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9878  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9879  __Pyx_RefNannyFinishContext();
9880  return __pyx_r;
9881 }
9882 
9883 /* "View.MemoryView":281
9884  * cdef class Enum(object):
9885  * cdef object name
9886  * def __init__(self, name): # <<<<<<<<<<<<<<
9887  * self.name = name
9888  * def __repr__(self):
9889  */
9890 
9891 /* Python wrapper */
9892 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9893 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9894  PyObject *__pyx_v_name = 0;
9895  int __pyx_lineno = 0;
9896  const char *__pyx_filename = NULL;
9897  int __pyx_clineno = 0;
9898  int __pyx_r;
9899  __Pyx_RefNannyDeclarations
9900  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9901  {
9902  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9903  PyObject* values[1] = {0};
9904  if (unlikely(__pyx_kwds)) {
9905  Py_ssize_t kw_args;
9906  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9907  switch (pos_args) {
9908  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9909  CYTHON_FALLTHROUGH;
9910  case 0: break;
9911  default: goto __pyx_L5_argtuple_error;
9912  }
9913  kw_args = PyDict_Size(__pyx_kwds);
9914  switch (pos_args) {
9915  case 0:
9916  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9917  else goto __pyx_L5_argtuple_error;
9918  }
9919  if (unlikely(kw_args > 0)) {
9920  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
9921  }
9922  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9923  goto __pyx_L5_argtuple_error;
9924  } else {
9925  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9926  }
9927  __pyx_v_name = values[0];
9928  }
9929  goto __pyx_L4_argument_unpacking_done;
9930  __pyx_L5_argtuple_error:;
9931  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
9932  __pyx_L3_error:;
9933  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9934  __Pyx_RefNannyFinishContext();
9935  return -1;
9936  __pyx_L4_argument_unpacking_done:;
9937  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9938 
9939  /* function exit code */
9940  __Pyx_RefNannyFinishContext();
9941  return __pyx_r;
9942 }
9943 
9944 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9945  int __pyx_r;
9946  __Pyx_RefNannyDeclarations
9947  __Pyx_RefNannySetupContext("__init__", 0);
9948 
9949  /* "View.MemoryView":282
9950  * cdef object name
9951  * def __init__(self, name):
9952  * self.name = name # <<<<<<<<<<<<<<
9953  * def __repr__(self):
9954  * return self.name
9955  */
9956  __Pyx_INCREF(__pyx_v_name);
9957  __Pyx_GIVEREF(__pyx_v_name);
9958  __Pyx_GOTREF(__pyx_v_self->name);
9959  __Pyx_DECREF(__pyx_v_self->name);
9960  __pyx_v_self->name = __pyx_v_name;
9961 
9962  /* "View.MemoryView":281
9963  * cdef class Enum(object):
9964  * cdef object name
9965  * def __init__(self, name): # <<<<<<<<<<<<<<
9966  * self.name = name
9967  * def __repr__(self):
9968  */
9969 
9970  /* function exit code */
9971  __pyx_r = 0;
9972  __Pyx_RefNannyFinishContext();
9973  return __pyx_r;
9974 }
9975 
9976 /* "View.MemoryView":283
9977  * def __init__(self, name):
9978  * self.name = name
9979  * def __repr__(self): # <<<<<<<<<<<<<<
9980  * return self.name
9981  *
9982  */
9983 
9984 /* Python wrapper */
9985 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9986 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9987  PyObject *__pyx_r = 0;
9988  __Pyx_RefNannyDeclarations
9989  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9990  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9991 
9992  /* function exit code */
9993  __Pyx_RefNannyFinishContext();
9994  return __pyx_r;
9995 }
9996 
9997 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9998  PyObject *__pyx_r = NULL;
9999  __Pyx_RefNannyDeclarations
10000  __Pyx_RefNannySetupContext("__repr__", 0);
10001 
10002  /* "View.MemoryView":284
10003  * self.name = name
10004  * def __repr__(self):
10005  * return self.name # <<<<<<<<<<<<<<
10006  *
10007  * cdef generic = Enum("<strided and direct or indirect>")
10008  */
10009  __Pyx_XDECREF(__pyx_r);
10010  __Pyx_INCREF(__pyx_v_self->name);
10011  __pyx_r = __pyx_v_self->name;
10012  goto __pyx_L0;
10013 
10014  /* "View.MemoryView":283
10015  * def __init__(self, name):
10016  * self.name = name
10017  * def __repr__(self): # <<<<<<<<<<<<<<
10018  * return self.name
10019  *
10020  */
10021 
10022  /* function exit code */
10023  __pyx_L0:;
10024  __Pyx_XGIVEREF(__pyx_r);
10025  __Pyx_RefNannyFinishContext();
10026  return __pyx_r;
10027 }
10028 
10029 /* "(tree fragment)":1
10030  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10031  * cdef tuple state
10032  * cdef object _dict
10033  */
10034 
10035 /* Python wrapper */
10036 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10037 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10038  PyObject *__pyx_r = 0;
10039  __Pyx_RefNannyDeclarations
10040  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10041  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10042 
10043  /* function exit code */
10044  __Pyx_RefNannyFinishContext();
10045  return __pyx_r;
10046 }
10047 
10048 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10049  PyObject *__pyx_v_state = 0;
10050  PyObject *__pyx_v__dict = 0;
10051  int __pyx_v_use_setstate;
10052  PyObject *__pyx_r = NULL;
10053  __Pyx_RefNannyDeclarations
10054  PyObject *__pyx_t_1 = NULL;
10055  int __pyx_t_2;
10056  int __pyx_t_3;
10057  PyObject *__pyx_t_4 = NULL;
10058  PyObject *__pyx_t_5 = NULL;
10059  int __pyx_lineno = 0;
10060  const char *__pyx_filename = NULL;
10061  int __pyx_clineno = 0;
10062  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10063 
10064  /* "(tree fragment)":5
10065  * cdef object _dict
10066  * cdef bint use_setstate
10067  * state = (self.name,) # <<<<<<<<<<<<<<
10068  * _dict = getattr(self, '__dict__', None)
10069  * if _dict is not None:
10070  */
10071  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10072  __Pyx_GOTREF(__pyx_t_1);
10073  __Pyx_INCREF(__pyx_v_self->name);
10074  __Pyx_GIVEREF(__pyx_v_self->name);
10075  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10076  __pyx_v_state = ((PyObject*)__pyx_t_1);
10077  __pyx_t_1 = 0;
10078 
10079  /* "(tree fragment)":6
10080  * cdef bint use_setstate
10081  * state = (self.name,)
10082  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10083  * if _dict is not None:
10084  * state += (_dict,)
10085  */
10086  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10087  __Pyx_GOTREF(__pyx_t_1);
10088  __pyx_v__dict = __pyx_t_1;
10089  __pyx_t_1 = 0;
10090 
10091  /* "(tree fragment)":7
10092  * state = (self.name,)
10093  * _dict = getattr(self, '__dict__', None)
10094  * if _dict is not None: # <<<<<<<<<<<<<<
10095  * state += (_dict,)
10096  * use_setstate = True
10097  */
10098  __pyx_t_2 = (__pyx_v__dict != Py_None);
10099  __pyx_t_3 = (__pyx_t_2 != 0);
10100  if (__pyx_t_3) {
10101 
10102  /* "(tree fragment)":8
10103  * _dict = getattr(self, '__dict__', None)
10104  * if _dict is not None:
10105  * state += (_dict,) # <<<<<<<<<<<<<<
10106  * use_setstate = True
10107  * else:
10108  */
10109  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10110  __Pyx_GOTREF(__pyx_t_1);
10111  __Pyx_INCREF(__pyx_v__dict);
10112  __Pyx_GIVEREF(__pyx_v__dict);
10113  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10114  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10115  __Pyx_GOTREF(__pyx_t_4);
10116  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10117  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10118  __pyx_t_4 = 0;
10119 
10120  /* "(tree fragment)":9
10121  * if _dict is not None:
10122  * state += (_dict,)
10123  * use_setstate = True # <<<<<<<<<<<<<<
10124  * else:
10125  * use_setstate = self.name is not None
10126  */
10127  __pyx_v_use_setstate = 1;
10128 
10129  /* "(tree fragment)":7
10130  * state = (self.name,)
10131  * _dict = getattr(self, '__dict__', None)
10132  * if _dict is not None: # <<<<<<<<<<<<<<
10133  * state += (_dict,)
10134  * use_setstate = True
10135  */
10136  goto __pyx_L3;
10137  }
10138 
10139  /* "(tree fragment)":11
10140  * use_setstate = True
10141  * else:
10142  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10143  * if use_setstate:
10144  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10145  */
10146  /*else*/ {
10147  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10148  __pyx_v_use_setstate = __pyx_t_3;
10149  }
10150  __pyx_L3:;
10151 
10152  /* "(tree fragment)":12
10153  * else:
10154  * use_setstate = self.name is not None
10155  * if use_setstate: # <<<<<<<<<<<<<<
10156  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10157  * else:
10158  */
10159  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10160  if (__pyx_t_3) {
10161 
10162  /* "(tree fragment)":13
10163  * use_setstate = self.name is not None
10164  * if use_setstate:
10165  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10166  * else:
10167  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10168  */
10169  __Pyx_XDECREF(__pyx_r);
10170  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10171  __Pyx_GOTREF(__pyx_t_4);
10172  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10173  __Pyx_GOTREF(__pyx_t_1);
10174  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10175  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10176  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10177  __Pyx_INCREF(__pyx_int_184977713);
10178  __Pyx_GIVEREF(__pyx_int_184977713);
10179  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10180  __Pyx_INCREF(Py_None);
10181  __Pyx_GIVEREF(Py_None);
10182  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10183  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10184  __Pyx_GOTREF(__pyx_t_5);
10185  __Pyx_GIVEREF(__pyx_t_4);
10186  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10187  __Pyx_GIVEREF(__pyx_t_1);
10188  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10189  __Pyx_INCREF(__pyx_v_state);
10190  __Pyx_GIVEREF(__pyx_v_state);
10191  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10192  __pyx_t_4 = 0;
10193  __pyx_t_1 = 0;
10194  __pyx_r = __pyx_t_5;
10195  __pyx_t_5 = 0;
10196  goto __pyx_L0;
10197 
10198  /* "(tree fragment)":12
10199  * else:
10200  * use_setstate = self.name is not None
10201  * if use_setstate: # <<<<<<<<<<<<<<
10202  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10203  * else:
10204  */
10205  }
10206 
10207  /* "(tree fragment)":15
10208  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10209  * else:
10210  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10211  * def __setstate_cython__(self, __pyx_state):
10212  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10213  */
10214  /*else*/ {
10215  __Pyx_XDECREF(__pyx_r);
10216  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10217  __Pyx_GOTREF(__pyx_t_5);
10218  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10219  __Pyx_GOTREF(__pyx_t_1);
10220  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10221  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10222  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10223  __Pyx_INCREF(__pyx_int_184977713);
10224  __Pyx_GIVEREF(__pyx_int_184977713);
10225  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10226  __Pyx_INCREF(__pyx_v_state);
10227  __Pyx_GIVEREF(__pyx_v_state);
10228  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10229  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10230  __Pyx_GOTREF(__pyx_t_4);
10231  __Pyx_GIVEREF(__pyx_t_5);
10232  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10233  __Pyx_GIVEREF(__pyx_t_1);
10234  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10235  __pyx_t_5 = 0;
10236  __pyx_t_1 = 0;
10237  __pyx_r = __pyx_t_4;
10238  __pyx_t_4 = 0;
10239  goto __pyx_L0;
10240  }
10241 
10242  /* "(tree fragment)":1
10243  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10244  * cdef tuple state
10245  * cdef object _dict
10246  */
10247 
10248  /* function exit code */
10249  __pyx_L1_error:;
10250  __Pyx_XDECREF(__pyx_t_1);
10251  __Pyx_XDECREF(__pyx_t_4);
10252  __Pyx_XDECREF(__pyx_t_5);
10253  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10254  __pyx_r = NULL;
10255  __pyx_L0:;
10256  __Pyx_XDECREF(__pyx_v_state);
10257  __Pyx_XDECREF(__pyx_v__dict);
10258  __Pyx_XGIVEREF(__pyx_r);
10259  __Pyx_RefNannyFinishContext();
10260  return __pyx_r;
10261 }
10262 
10263 /* "(tree fragment)":16
10264  * else:
10265  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10266  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10267  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10268  */
10269 
10270 /* Python wrapper */
10271 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10272 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10273  PyObject *__pyx_r = 0;
10274  __Pyx_RefNannyDeclarations
10275  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10276  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10277 
10278  /* function exit code */
10279  __Pyx_RefNannyFinishContext();
10280  return __pyx_r;
10281 }
10282 
10283 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10284  PyObject *__pyx_r = NULL;
10285  __Pyx_RefNannyDeclarations
10286  PyObject *__pyx_t_1 = NULL;
10287  int __pyx_lineno = 0;
10288  const char *__pyx_filename = NULL;
10289  int __pyx_clineno = 0;
10290  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10291 
10292  /* "(tree fragment)":17
10293  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10294  * def __setstate_cython__(self, __pyx_state):
10295  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10296  */
10297  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10298  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10299  __Pyx_GOTREF(__pyx_t_1);
10300  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10301 
10302  /* "(tree fragment)":16
10303  * else:
10304  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10305  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10306  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10307  */
10308 
10309  /* function exit code */
10310  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10311  goto __pyx_L0;
10312  __pyx_L1_error:;
10313  __Pyx_XDECREF(__pyx_t_1);
10314  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10315  __pyx_r = NULL;
10316  __pyx_L0:;
10317  __Pyx_XGIVEREF(__pyx_r);
10318  __Pyx_RefNannyFinishContext();
10319  return __pyx_r;
10320 }
10321 
10322 /* "View.MemoryView":298
10323  *
10324  * @cname('__pyx_align_pointer')
10325  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10326  * "Align pointer memory on a given boundary"
10327  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10328  */
10329 
10330 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10331  Py_intptr_t __pyx_v_aligned_p;
10332  size_t __pyx_v_offset;
10333  void *__pyx_r;
10334  int __pyx_t_1;
10335 
10336  /* "View.MemoryView":300
10337  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10338  * "Align pointer memory on a given boundary"
10339  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10340  * cdef size_t offset
10341  *
10342  */
10343  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10344 
10345  /* "View.MemoryView":304
10346  *
10347  * with cython.cdivision(True):
10348  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10349  *
10350  * if offset > 0:
10351  */
10352  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10353 
10354  /* "View.MemoryView":306
10355  * offset = aligned_p % alignment
10356  *
10357  * if offset > 0: # <<<<<<<<<<<<<<
10358  * aligned_p += alignment - offset
10359  *
10360  */
10361  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10362  if (__pyx_t_1) {
10363 
10364  /* "View.MemoryView":307
10365  *
10366  * if offset > 0:
10367  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10368  *
10369  * return <void *> aligned_p
10370  */
10371  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10372 
10373  /* "View.MemoryView":306
10374  * offset = aligned_p % alignment
10375  *
10376  * if offset > 0: # <<<<<<<<<<<<<<
10377  * aligned_p += alignment - offset
10378  *
10379  */
10380  }
10381 
10382  /* "View.MemoryView":309
10383  * aligned_p += alignment - offset
10384  *
10385  * return <void *> aligned_p # <<<<<<<<<<<<<<
10386  *
10387  *
10388  */
10389  __pyx_r = ((void *)__pyx_v_aligned_p);
10390  goto __pyx_L0;
10391 
10392  /* "View.MemoryView":298
10393  *
10394  * @cname('__pyx_align_pointer')
10395  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10396  * "Align pointer memory on a given boundary"
10397  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10398  */
10399 
10400  /* function exit code */
10401  __pyx_L0:;
10402  return __pyx_r;
10403 }
10404 
10405 /* "View.MemoryView":345
10406  * cdef __Pyx_TypeInfo *typeinfo
10407  *
10408  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10409  * self.obj = obj
10410  * self.flags = flags
10411  */
10412 
10413 /* Python wrapper */
10414 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10415 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10416  PyObject *__pyx_v_obj = 0;
10417  int __pyx_v_flags;
10418  int __pyx_v_dtype_is_object;
10419  int __pyx_lineno = 0;
10420  const char *__pyx_filename = NULL;
10421  int __pyx_clineno = 0;
10422  int __pyx_r;
10423  __Pyx_RefNannyDeclarations
10424  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10425  {
10426  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10427  PyObject* values[3] = {0,0,0};
10428  if (unlikely(__pyx_kwds)) {
10429  Py_ssize_t kw_args;
10430  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10431  switch (pos_args) {
10432  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10433  CYTHON_FALLTHROUGH;
10434  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10435  CYTHON_FALLTHROUGH;
10436  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10437  CYTHON_FALLTHROUGH;
10438  case 0: break;
10439  default: goto __pyx_L5_argtuple_error;
10440  }
10441  kw_args = PyDict_Size(__pyx_kwds);
10442  switch (pos_args) {
10443  case 0:
10444  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10445  else goto __pyx_L5_argtuple_error;
10446  CYTHON_FALLTHROUGH;
10447  case 1:
10448  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10449  else {
10450  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10451  }
10452  CYTHON_FALLTHROUGH;
10453  case 2:
10454  if (kw_args > 0) {
10455  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10456  if (value) { values[2] = value; kw_args--; }
10457  }
10458  }
10459  if (unlikely(kw_args > 0)) {
10460  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10461  }
10462  } else {
10463  switch (PyTuple_GET_SIZE(__pyx_args)) {
10464  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10465  CYTHON_FALLTHROUGH;
10466  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10467  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10468  break;
10469  default: goto __pyx_L5_argtuple_error;
10470  }
10471  }
10472  __pyx_v_obj = values[0];
10473  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10474  if (values[2]) {
10475  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10476  } else {
10477  __pyx_v_dtype_is_object = ((int)0);
10478  }
10479  }
10480  goto __pyx_L4_argument_unpacking_done;
10481  __pyx_L5_argtuple_error:;
10482  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10483  __pyx_L3_error:;
10484  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10485  __Pyx_RefNannyFinishContext();
10486  return -1;
10487  __pyx_L4_argument_unpacking_done:;
10488  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10489 
10490  /* function exit code */
10491  __Pyx_RefNannyFinishContext();
10492  return __pyx_r;
10493 }
10494 
10495 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10496  int __pyx_r;
10497  __Pyx_RefNannyDeclarations
10498  int __pyx_t_1;
10499  int __pyx_t_2;
10500  int __pyx_t_3;
10501  int __pyx_t_4;
10502  int __pyx_lineno = 0;
10503  const char *__pyx_filename = NULL;
10504  int __pyx_clineno = 0;
10505  __Pyx_RefNannySetupContext("__cinit__", 0);
10506 
10507  /* "View.MemoryView":346
10508  *
10509  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10510  * self.obj = obj # <<<<<<<<<<<<<<
10511  * self.flags = flags
10512  * if type(self) is memoryview or obj is not None:
10513  */
10514  __Pyx_INCREF(__pyx_v_obj);
10515  __Pyx_GIVEREF(__pyx_v_obj);
10516  __Pyx_GOTREF(__pyx_v_self->obj);
10517  __Pyx_DECREF(__pyx_v_self->obj);
10518  __pyx_v_self->obj = __pyx_v_obj;
10519 
10520  /* "View.MemoryView":347
10521  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10522  * self.obj = obj
10523  * self.flags = flags # <<<<<<<<<<<<<<
10524  * if type(self) is memoryview or obj is not None:
10525  * __Pyx_GetBuffer(obj, &self.view, flags)
10526  */
10527  __pyx_v_self->flags = __pyx_v_flags;
10528 
10529  /* "View.MemoryView":348
10530  * self.obj = obj
10531  * self.flags = flags
10532  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10533  * __Pyx_GetBuffer(obj, &self.view, flags)
10534  * if <PyObject *> self.view.obj == NULL:
10535  */
10536  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10537  __pyx_t_3 = (__pyx_t_2 != 0);
10538  if (!__pyx_t_3) {
10539  } else {
10540  __pyx_t_1 = __pyx_t_3;
10541  goto __pyx_L4_bool_binop_done;
10542  }
10543  __pyx_t_3 = (__pyx_v_obj != Py_None);
10544  __pyx_t_2 = (__pyx_t_3 != 0);
10545  __pyx_t_1 = __pyx_t_2;
10546  __pyx_L4_bool_binop_done:;
10547  if (__pyx_t_1) {
10548 
10549  /* "View.MemoryView":349
10550  * self.flags = flags
10551  * if type(self) is memoryview or obj is not None:
10552  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10553  * if <PyObject *> self.view.obj == NULL:
10554  * (<__pyx_buffer *> &self.view).obj = Py_None
10555  */
10556  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10557 
10558  /* "View.MemoryView":350
10559  * if type(self) is memoryview or obj is not None:
10560  * __Pyx_GetBuffer(obj, &self.view, flags)
10561  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10562  * (<__pyx_buffer *> &self.view).obj = Py_None
10563  * Py_INCREF(Py_None)
10564  */
10565  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10566  if (__pyx_t_1) {
10567 
10568  /* "View.MemoryView":351
10569  * __Pyx_GetBuffer(obj, &self.view, flags)
10570  * if <PyObject *> self.view.obj == NULL:
10571  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10572  * Py_INCREF(Py_None)
10573  *
10574  */
10575  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10576 
10577  /* "View.MemoryView":352
10578  * if <PyObject *> self.view.obj == NULL:
10579  * (<__pyx_buffer *> &self.view).obj = Py_None
10580  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10581  *
10582  * global __pyx_memoryview_thread_locks_used
10583  */
10584  Py_INCREF(Py_None);
10585 
10586  /* "View.MemoryView":350
10587  * if type(self) is memoryview or obj is not None:
10588  * __Pyx_GetBuffer(obj, &self.view, flags)
10589  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10590  * (<__pyx_buffer *> &self.view).obj = Py_None
10591  * Py_INCREF(Py_None)
10592  */
10593  }
10594 
10595  /* "View.MemoryView":348
10596  * self.obj = obj
10597  * self.flags = flags
10598  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10599  * __Pyx_GetBuffer(obj, &self.view, flags)
10600  * if <PyObject *> self.view.obj == NULL:
10601  */
10602  }
10603 
10604  /* "View.MemoryView":355
10605  *
10606  * global __pyx_memoryview_thread_locks_used
10607  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10608  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10609  * __pyx_memoryview_thread_locks_used += 1
10610  */
10611  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10612  if (__pyx_t_1) {
10613 
10614  /* "View.MemoryView":356
10615  * global __pyx_memoryview_thread_locks_used
10616  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10617  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10618  * __pyx_memoryview_thread_locks_used += 1
10619  * if self.lock is NULL:
10620  */
10621  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10622 
10623  /* "View.MemoryView":357
10624  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10625  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10626  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10627  * if self.lock is NULL:
10628  * self.lock = PyThread_allocate_lock()
10629  */
10630  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10631 
10632  /* "View.MemoryView":355
10633  *
10634  * global __pyx_memoryview_thread_locks_used
10635  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10636  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10637  * __pyx_memoryview_thread_locks_used += 1
10638  */
10639  }
10640 
10641  /* "View.MemoryView":358
10642  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10643  * __pyx_memoryview_thread_locks_used += 1
10644  * if self.lock is NULL: # <<<<<<<<<<<<<<
10645  * self.lock = PyThread_allocate_lock()
10646  * if self.lock is NULL:
10647  */
10648  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10649  if (__pyx_t_1) {
10650 
10651  /* "View.MemoryView":359
10652  * __pyx_memoryview_thread_locks_used += 1
10653  * if self.lock is NULL:
10654  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10655  * if self.lock is NULL:
10656  * raise MemoryError
10657  */
10658  __pyx_v_self->lock = PyThread_allocate_lock();
10659 
10660  /* "View.MemoryView":360
10661  * if self.lock is NULL:
10662  * self.lock = PyThread_allocate_lock()
10663  * if self.lock is NULL: # <<<<<<<<<<<<<<
10664  * raise MemoryError
10665  *
10666  */
10667  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10668  if (unlikely(__pyx_t_1)) {
10669 
10670  /* "View.MemoryView":361
10671  * self.lock = PyThread_allocate_lock()
10672  * if self.lock is NULL:
10673  * raise MemoryError # <<<<<<<<<<<<<<
10674  *
10675  * if flags & PyBUF_FORMAT:
10676  */
10677  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10678 
10679  /* "View.MemoryView":360
10680  * if self.lock is NULL:
10681  * self.lock = PyThread_allocate_lock()
10682  * if self.lock is NULL: # <<<<<<<<<<<<<<
10683  * raise MemoryError
10684  *
10685  */
10686  }
10687 
10688  /* "View.MemoryView":358
10689  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10690  * __pyx_memoryview_thread_locks_used += 1
10691  * if self.lock is NULL: # <<<<<<<<<<<<<<
10692  * self.lock = PyThread_allocate_lock()
10693  * if self.lock is NULL:
10694  */
10695  }
10696 
10697  /* "View.MemoryView":363
10698  * raise MemoryError
10699  *
10700  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10701  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10702  * else:
10703  */
10704  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10705  if (__pyx_t_1) {
10706 
10707  /* "View.MemoryView":364
10708  *
10709  * if flags & PyBUF_FORMAT:
10710  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10711  * else:
10712  * self.dtype_is_object = dtype_is_object
10713  */
10714  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10715  if (__pyx_t_2) {
10716  } else {
10717  __pyx_t_1 = __pyx_t_2;
10718  goto __pyx_L11_bool_binop_done;
10719  }
10720  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10721  __pyx_t_1 = __pyx_t_2;
10722  __pyx_L11_bool_binop_done:;
10723  __pyx_v_self->dtype_is_object = __pyx_t_1;
10724 
10725  /* "View.MemoryView":363
10726  * raise MemoryError
10727  *
10728  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10729  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10730  * else:
10731  */
10732  goto __pyx_L10;
10733  }
10734 
10735  /* "View.MemoryView":366
10736  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10737  * else:
10738  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10739  *
10740  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10741  */
10742  /*else*/ {
10743  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10744  }
10745  __pyx_L10:;
10746 
10747  /* "View.MemoryView":368
10748  * self.dtype_is_object = dtype_is_object
10749  *
10750  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10751  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10752  * self.typeinfo = NULL
10753  */
10754  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10755 
10756  /* "View.MemoryView":370
10757  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10758  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10759  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10760  *
10761  * def __dealloc__(memoryview self):
10762  */
10763  __pyx_v_self->typeinfo = NULL;
10764 
10765  /* "View.MemoryView":345
10766  * cdef __Pyx_TypeInfo *typeinfo
10767  *
10768  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10769  * self.obj = obj
10770  * self.flags = flags
10771  */
10772 
10773  /* function exit code */
10774  __pyx_r = 0;
10775  goto __pyx_L0;
10776  __pyx_L1_error:;
10777  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10778  __pyx_r = -1;
10779  __pyx_L0:;
10780  __Pyx_RefNannyFinishContext();
10781  return __pyx_r;
10782 }
10783 
10784 /* "View.MemoryView":372
10785  * self.typeinfo = NULL
10786  *
10787  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10788  * if self.obj is not None:
10789  * __Pyx_ReleaseBuffer(&self.view)
10790  */
10791 
10792 /* Python wrapper */
10793 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10794 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10795  __Pyx_RefNannyDeclarations
10796  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10797  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10798 
10799  /* function exit code */
10800  __Pyx_RefNannyFinishContext();
10801 }
10802 
10803 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10804  int __pyx_v_i;
10805  __Pyx_RefNannyDeclarations
10806  int __pyx_t_1;
10807  int __pyx_t_2;
10808  int __pyx_t_3;
10809  int __pyx_t_4;
10810  int __pyx_t_5;
10811  PyThread_type_lock __pyx_t_6;
10812  PyThread_type_lock __pyx_t_7;
10813  __Pyx_RefNannySetupContext("__dealloc__", 0);
10814 
10815  /* "View.MemoryView":373
10816  *
10817  * def __dealloc__(memoryview self):
10818  * if self.obj is not None: # <<<<<<<<<<<<<<
10819  * __Pyx_ReleaseBuffer(&self.view)
10820  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10821  */
10822  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10823  __pyx_t_2 = (__pyx_t_1 != 0);
10824  if (__pyx_t_2) {
10825 
10826  /* "View.MemoryView":374
10827  * def __dealloc__(memoryview self):
10828  * if self.obj is not None:
10829  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10830  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10831  *
10832  */
10833  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10834 
10835  /* "View.MemoryView":373
10836  *
10837  * def __dealloc__(memoryview self):
10838  * if self.obj is not None: # <<<<<<<<<<<<<<
10839  * __Pyx_ReleaseBuffer(&self.view)
10840  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10841  */
10842  goto __pyx_L3;
10843  }
10844 
10845  /* "View.MemoryView":375
10846  * if self.obj is not None:
10847  * __Pyx_ReleaseBuffer(&self.view)
10848  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10849  *
10850  * (<__pyx_buffer *> &self.view).obj = NULL
10851  */
10852  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10853  if (__pyx_t_2) {
10854 
10855  /* "View.MemoryView":377
10856  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10857  *
10858  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10859  * Py_DECREF(Py_None)
10860  *
10861  */
10862  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10863 
10864  /* "View.MemoryView":378
10865  *
10866  * (<__pyx_buffer *> &self.view).obj = NULL
10867  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10868  *
10869  * cdef int i
10870  */
10871  Py_DECREF(Py_None);
10872 
10873  /* "View.MemoryView":375
10874  * if self.obj is not None:
10875  * __Pyx_ReleaseBuffer(&self.view)
10876  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10877  *
10878  * (<__pyx_buffer *> &self.view).obj = NULL
10879  */
10880  }
10881  __pyx_L3:;
10882 
10883  /* "View.MemoryView":382
10884  * cdef int i
10885  * global __pyx_memoryview_thread_locks_used
10886  * if self.lock != NULL: # <<<<<<<<<<<<<<
10887  * for i in range(__pyx_memoryview_thread_locks_used):
10888  * if __pyx_memoryview_thread_locks[i] is self.lock:
10889  */
10890  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10891  if (__pyx_t_2) {
10892 
10893  /* "View.MemoryView":383
10894  * global __pyx_memoryview_thread_locks_used
10895  * if self.lock != NULL:
10896  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10897  * if __pyx_memoryview_thread_locks[i] is self.lock:
10898  * __pyx_memoryview_thread_locks_used -= 1
10899  */
10900  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10901  __pyx_t_4 = __pyx_t_3;
10902  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10903  __pyx_v_i = __pyx_t_5;
10904 
10905  /* "View.MemoryView":384
10906  * if self.lock != NULL:
10907  * for i in range(__pyx_memoryview_thread_locks_used):
10908  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10909  * __pyx_memoryview_thread_locks_used -= 1
10910  * if i != __pyx_memoryview_thread_locks_used:
10911  */
10912  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10913  if (__pyx_t_2) {
10914 
10915  /* "View.MemoryView":385
10916  * for i in range(__pyx_memoryview_thread_locks_used):
10917  * if __pyx_memoryview_thread_locks[i] is self.lock:
10918  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10919  * if i != __pyx_memoryview_thread_locks_used:
10920  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10921  */
10922  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10923 
10924  /* "View.MemoryView":386
10925  * if __pyx_memoryview_thread_locks[i] is self.lock:
10926  * __pyx_memoryview_thread_locks_used -= 1
10927  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10928  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10929  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10930  */
10931  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10932  if (__pyx_t_2) {
10933 
10934  /* "View.MemoryView":388
10935  * if i != __pyx_memoryview_thread_locks_used:
10936  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10937  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10938  * break
10939  * else:
10940  */
10941  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10942  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10943 
10944  /* "View.MemoryView":387
10945  * __pyx_memoryview_thread_locks_used -= 1
10946  * if i != __pyx_memoryview_thread_locks_used:
10947  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10948  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10949  * break
10950  */
10951  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10952  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10953 
10954  /* "View.MemoryView":386
10955  * if __pyx_memoryview_thread_locks[i] is self.lock:
10956  * __pyx_memoryview_thread_locks_used -= 1
10957  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10958  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10959  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10960  */
10961  }
10962 
10963  /* "View.MemoryView":389
10964  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10965  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10966  * break # <<<<<<<<<<<<<<
10967  * else:
10968  * PyThread_free_lock(self.lock)
10969  */
10970  goto __pyx_L6_break;
10971 
10972  /* "View.MemoryView":384
10973  * if self.lock != NULL:
10974  * for i in range(__pyx_memoryview_thread_locks_used):
10975  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10976  * __pyx_memoryview_thread_locks_used -= 1
10977  * if i != __pyx_memoryview_thread_locks_used:
10978  */
10979  }
10980  }
10981  /*else*/ {
10982 
10983  /* "View.MemoryView":391
10984  * break
10985  * else:
10986  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10987  *
10988  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10989  */
10990  PyThread_free_lock(__pyx_v_self->lock);
10991  }
10992  __pyx_L6_break:;
10993 
10994  /* "View.MemoryView":382
10995  * cdef int i
10996  * global __pyx_memoryview_thread_locks_used
10997  * if self.lock != NULL: # <<<<<<<<<<<<<<
10998  * for i in range(__pyx_memoryview_thread_locks_used):
10999  * if __pyx_memoryview_thread_locks[i] is self.lock:
11000  */
11001  }
11002 
11003  /* "View.MemoryView":372
11004  * self.typeinfo = NULL
11005  *
11006  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11007  * if self.obj is not None:
11008  * __Pyx_ReleaseBuffer(&self.view)
11009  */
11010 
11011  /* function exit code */
11012  __Pyx_RefNannyFinishContext();
11013 }
11014 
11015 /* "View.MemoryView":393
11016  * PyThread_free_lock(self.lock)
11017  *
11018  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11019  * cdef Py_ssize_t dim
11020  * cdef char *itemp = <char *> self.view.buf
11021  */
11022 
11023 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11024  Py_ssize_t __pyx_v_dim;
11025  char *__pyx_v_itemp;
11026  PyObject *__pyx_v_idx = NULL;
11027  char *__pyx_r;
11028  __Pyx_RefNannyDeclarations
11029  Py_ssize_t __pyx_t_1;
11030  PyObject *__pyx_t_2 = NULL;
11031  Py_ssize_t __pyx_t_3;
11032  PyObject *(*__pyx_t_4)(PyObject *);
11033  PyObject *__pyx_t_5 = NULL;
11034  Py_ssize_t __pyx_t_6;
11035  char *__pyx_t_7;
11036  int __pyx_lineno = 0;
11037  const char *__pyx_filename = NULL;
11038  int __pyx_clineno = 0;
11039  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11040 
11041  /* "View.MemoryView":395
11042  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11043  * cdef Py_ssize_t dim
11044  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11045  *
11046  * for dim, idx in enumerate(index):
11047  */
11048  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11049 
11050  /* "View.MemoryView":397
11051  * cdef char *itemp = <char *> self.view.buf
11052  *
11053  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11054  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11055  *
11056  */
11057  __pyx_t_1 = 0;
11058  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11059  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11060  __pyx_t_4 = NULL;
11061  } else {
11062  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11063  __Pyx_GOTREF(__pyx_t_2);
11064  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11065  }
11066  for (;;) {
11067  if (likely(!__pyx_t_4)) {
11068  if (likely(PyList_CheckExact(__pyx_t_2))) {
11069  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11070  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11071  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11072  #else
11073  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11074  __Pyx_GOTREF(__pyx_t_5);
11075  #endif
11076  } else {
11077  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11078  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11079  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11080  #else
11081  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11082  __Pyx_GOTREF(__pyx_t_5);
11083  #endif
11084  }
11085  } else {
11086  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11087  if (unlikely(!__pyx_t_5)) {
11088  PyObject* exc_type = PyErr_Occurred();
11089  if (exc_type) {
11090  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11091  else __PYX_ERR(1, 397, __pyx_L1_error)
11092  }
11093  break;
11094  }
11095  __Pyx_GOTREF(__pyx_t_5);
11096  }
11097  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11098  __pyx_t_5 = 0;
11099  __pyx_v_dim = __pyx_t_1;
11100  __pyx_t_1 = (__pyx_t_1 + 1);
11101 
11102  /* "View.MemoryView":398
11103  *
11104  * for dim, idx in enumerate(index):
11105  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11106  *
11107  * return itemp
11108  */
11109  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
11110  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
11111  __pyx_v_itemp = __pyx_t_7;
11112 
11113  /* "View.MemoryView":397
11114  * cdef char *itemp = <char *> self.view.buf
11115  *
11116  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11117  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11118  *
11119  */
11120  }
11121  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11122 
11123  /* "View.MemoryView":400
11124  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11125  *
11126  * return itemp # <<<<<<<<<<<<<<
11127  *
11128  *
11129  */
11130  __pyx_r = __pyx_v_itemp;
11131  goto __pyx_L0;
11132 
11133  /* "View.MemoryView":393
11134  * PyThread_free_lock(self.lock)
11135  *
11136  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11137  * cdef Py_ssize_t dim
11138  * cdef char *itemp = <char *> self.view.buf
11139  */
11140 
11141  /* function exit code */
11142  __pyx_L1_error:;
11143  __Pyx_XDECREF(__pyx_t_2);
11144  __Pyx_XDECREF(__pyx_t_5);
11145  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11146  __pyx_r = NULL;
11147  __pyx_L0:;
11148  __Pyx_XDECREF(__pyx_v_idx);
11149  __Pyx_RefNannyFinishContext();
11150  return __pyx_r;
11151 }
11152 
11153 /* "View.MemoryView":403
11154  *
11155  *
11156  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11157  * if index is Ellipsis:
11158  * return self
11159  */
11160 
11161 /* Python wrapper */
11162 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11163 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11164  PyObject *__pyx_r = 0;
11165  __Pyx_RefNannyDeclarations
11166  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11167  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11168 
11169  /* function exit code */
11170  __Pyx_RefNannyFinishContext();
11171  return __pyx_r;
11172 }
11173 
11174 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11175  PyObject *__pyx_v_have_slices = NULL;
11176  PyObject *__pyx_v_indices = NULL;
11177  char *__pyx_v_itemp;
11178  PyObject *__pyx_r = NULL;
11179  __Pyx_RefNannyDeclarations
11180  int __pyx_t_1;
11181  int __pyx_t_2;
11182  PyObject *__pyx_t_3 = NULL;
11183  PyObject *__pyx_t_4 = NULL;
11184  PyObject *__pyx_t_5 = NULL;
11185  char *__pyx_t_6;
11186  int __pyx_lineno = 0;
11187  const char *__pyx_filename = NULL;
11188  int __pyx_clineno = 0;
11189  __Pyx_RefNannySetupContext("__getitem__", 0);
11190 
11191  /* "View.MemoryView":404
11192  *
11193  * def __getitem__(memoryview self, object index):
11194  * if index is Ellipsis: # <<<<<<<<<<<<<<
11195  * return self
11196  *
11197  */
11198  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11199  __pyx_t_2 = (__pyx_t_1 != 0);
11200  if (__pyx_t_2) {
11201 
11202  /* "View.MemoryView":405
11203  * def __getitem__(memoryview self, object index):
11204  * if index is Ellipsis:
11205  * return self # <<<<<<<<<<<<<<
11206  *
11207  * have_slices, indices = _unellipsify(index, self.view.ndim)
11208  */
11209  __Pyx_XDECREF(__pyx_r);
11210  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11211  __pyx_r = ((PyObject *)__pyx_v_self);
11212  goto __pyx_L0;
11213 
11214  /* "View.MemoryView":404
11215  *
11216  * def __getitem__(memoryview self, object index):
11217  * if index is Ellipsis: # <<<<<<<<<<<<<<
11218  * return self
11219  *
11220  */
11221  }
11222 
11223  /* "View.MemoryView":407
11224  * return self
11225  *
11226  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11227  *
11228  * cdef char *itemp
11229  */
11230  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11231  __Pyx_GOTREF(__pyx_t_3);
11232  if (likely(__pyx_t_3 != Py_None)) {
11233  PyObject* sequence = __pyx_t_3;
11234  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11235  if (unlikely(size != 2)) {
11236  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11237  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11238  __PYX_ERR(1, 407, __pyx_L1_error)
11239  }
11240  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11241  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11242  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11243  __Pyx_INCREF(__pyx_t_4);
11244  __Pyx_INCREF(__pyx_t_5);
11245  #else
11246  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11247  __Pyx_GOTREF(__pyx_t_4);
11248  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11249  __Pyx_GOTREF(__pyx_t_5);
11250  #endif
11251  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11252  } else {
11253  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11254  }
11255  __pyx_v_have_slices = __pyx_t_4;
11256  __pyx_t_4 = 0;
11257  __pyx_v_indices = __pyx_t_5;
11258  __pyx_t_5 = 0;
11259 
11260  /* "View.MemoryView":410
11261  *
11262  * cdef char *itemp
11263  * if have_slices: # <<<<<<<<<<<<<<
11264  * return memview_slice(self, indices)
11265  * else:
11266  */
11267  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11268  if (__pyx_t_2) {
11269 
11270  /* "View.MemoryView":411
11271  * cdef char *itemp
11272  * if have_slices:
11273  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11274  * else:
11275  * itemp = self.get_item_pointer(indices)
11276  */
11277  __Pyx_XDECREF(__pyx_r);
11278  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11279  __Pyx_GOTREF(__pyx_t_3);
11280  __pyx_r = __pyx_t_3;
11281  __pyx_t_3 = 0;
11282  goto __pyx_L0;
11283 
11284  /* "View.MemoryView":410
11285  *
11286  * cdef char *itemp
11287  * if have_slices: # <<<<<<<<<<<<<<
11288  * return memview_slice(self, indices)
11289  * else:
11290  */
11291  }
11292 
11293  /* "View.MemoryView":413
11294  * return memview_slice(self, indices)
11295  * else:
11296  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11297  * return self.convert_item_to_object(itemp)
11298  *
11299  */
11300  /*else*/ {
11301  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11302  __pyx_v_itemp = __pyx_t_6;
11303 
11304  /* "View.MemoryView":414
11305  * else:
11306  * itemp = self.get_item_pointer(indices)
11307  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11308  *
11309  * def __setitem__(memoryview self, object index, object value):
11310  */
11311  __Pyx_XDECREF(__pyx_r);
11312  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11313  __Pyx_GOTREF(__pyx_t_3);
11314  __pyx_r = __pyx_t_3;
11315  __pyx_t_3 = 0;
11316  goto __pyx_L0;
11317  }
11318 
11319  /* "View.MemoryView":403
11320  *
11321  *
11322  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11323  * if index is Ellipsis:
11324  * return self
11325  */
11326 
11327  /* function exit code */
11328  __pyx_L1_error:;
11329  __Pyx_XDECREF(__pyx_t_3);
11330  __Pyx_XDECREF(__pyx_t_4);
11331  __Pyx_XDECREF(__pyx_t_5);
11332  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11333  __pyx_r = NULL;
11334  __pyx_L0:;
11335  __Pyx_XDECREF(__pyx_v_have_slices);
11336  __Pyx_XDECREF(__pyx_v_indices);
11337  __Pyx_XGIVEREF(__pyx_r);
11338  __Pyx_RefNannyFinishContext();
11339  return __pyx_r;
11340 }
11341 
11342 /* "View.MemoryView":416
11343  * return self.convert_item_to_object(itemp)
11344  *
11345  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11346  * if self.view.readonly:
11347  * raise TypeError("Cannot assign to read-only memoryview")
11348  */
11349 
11350 /* Python wrapper */
11351 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11352 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11353  int __pyx_r;
11354  __Pyx_RefNannyDeclarations
11355  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11356  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11357 
11358  /* function exit code */
11359  __Pyx_RefNannyFinishContext();
11360  return __pyx_r;
11361 }
11362 
11363 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11364  PyObject *__pyx_v_have_slices = NULL;
11365  PyObject *__pyx_v_obj = NULL;
11366  int __pyx_r;
11367  __Pyx_RefNannyDeclarations
11368  int __pyx_t_1;
11369  PyObject *__pyx_t_2 = NULL;
11370  PyObject *__pyx_t_3 = NULL;
11371  PyObject *__pyx_t_4 = NULL;
11372  int __pyx_lineno = 0;
11373  const char *__pyx_filename = NULL;
11374  int __pyx_clineno = 0;
11375  __Pyx_RefNannySetupContext("__setitem__", 0);
11376  __Pyx_INCREF(__pyx_v_index);
11377 
11378  /* "View.MemoryView":417
11379  *
11380  * def __setitem__(memoryview self, object index, object value):
11381  * if self.view.readonly: # <<<<<<<<<<<<<<
11382  * raise TypeError("Cannot assign to read-only memoryview")
11383  *
11384  */
11385  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11386  if (unlikely(__pyx_t_1)) {
11387 
11388  /* "View.MemoryView":418
11389  * def __setitem__(memoryview self, object index, object value):
11390  * if self.view.readonly:
11391  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11392  *
11393  * have_slices, index = _unellipsify(index, self.view.ndim)
11394  */
11395  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11396  __Pyx_GOTREF(__pyx_t_2);
11397  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11398  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11399  __PYX_ERR(1, 418, __pyx_L1_error)
11400 
11401  /* "View.MemoryView":417
11402  *
11403  * def __setitem__(memoryview self, object index, object value):
11404  * if self.view.readonly: # <<<<<<<<<<<<<<
11405  * raise TypeError("Cannot assign to read-only memoryview")
11406  *
11407  */
11408  }
11409 
11410  /* "View.MemoryView":420
11411  * raise TypeError("Cannot assign to read-only memoryview")
11412  *
11413  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11414  *
11415  * if have_slices:
11416  */
11417  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11418  __Pyx_GOTREF(__pyx_t_2);
11419  if (likely(__pyx_t_2 != Py_None)) {
11420  PyObject* sequence = __pyx_t_2;
11421  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11422  if (unlikely(size != 2)) {
11423  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11424  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11425  __PYX_ERR(1, 420, __pyx_L1_error)
11426  }
11427  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11428  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11429  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11430  __Pyx_INCREF(__pyx_t_3);
11431  __Pyx_INCREF(__pyx_t_4);
11432  #else
11433  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11434  __Pyx_GOTREF(__pyx_t_3);
11435  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11436  __Pyx_GOTREF(__pyx_t_4);
11437  #endif
11438  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11439  } else {
11440  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11441  }
11442  __pyx_v_have_slices = __pyx_t_3;
11443  __pyx_t_3 = 0;
11444  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11445  __pyx_t_4 = 0;
11446 
11447  /* "View.MemoryView":422
11448  * have_slices, index = _unellipsify(index, self.view.ndim)
11449  *
11450  * if have_slices: # <<<<<<<<<<<<<<
11451  * obj = self.is_slice(value)
11452  * if obj:
11453  */
11454  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11455  if (__pyx_t_1) {
11456 
11457  /* "View.MemoryView":423
11458  *
11459  * if have_slices:
11460  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11461  * if obj:
11462  * self.setitem_slice_assignment(self[index], obj)
11463  */
11464  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11465  __Pyx_GOTREF(__pyx_t_2);
11466  __pyx_v_obj = __pyx_t_2;
11467  __pyx_t_2 = 0;
11468 
11469  /* "View.MemoryView":424
11470  * if have_slices:
11471  * obj = self.is_slice(value)
11472  * if obj: # <<<<<<<<<<<<<<
11473  * self.setitem_slice_assignment(self[index], obj)
11474  * else:
11475  */
11476  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11477  if (__pyx_t_1) {
11478 
11479  /* "View.MemoryView":425
11480  * obj = self.is_slice(value)
11481  * if obj:
11482  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11483  * else:
11484  * self.setitem_slice_assign_scalar(self[index], value)
11485  */
11486  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11487  __Pyx_GOTREF(__pyx_t_2);
11488  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11489  __Pyx_GOTREF(__pyx_t_4);
11490  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11491  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11492 
11493  /* "View.MemoryView":424
11494  * if have_slices:
11495  * obj = self.is_slice(value)
11496  * if obj: # <<<<<<<<<<<<<<
11497  * self.setitem_slice_assignment(self[index], obj)
11498  * else:
11499  */
11500  goto __pyx_L5;
11501  }
11502 
11503  /* "View.MemoryView":427
11504  * self.setitem_slice_assignment(self[index], obj)
11505  * else:
11506  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11507  * else:
11508  * self.setitem_indexed(index, value)
11509  */
11510  /*else*/ {
11511  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11512  __Pyx_GOTREF(__pyx_t_4);
11513  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11514  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11515  __Pyx_GOTREF(__pyx_t_2);
11516  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11517  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11518  }
11519  __pyx_L5:;
11520 
11521  /* "View.MemoryView":422
11522  * have_slices, index = _unellipsify(index, self.view.ndim)
11523  *
11524  * if have_slices: # <<<<<<<<<<<<<<
11525  * obj = self.is_slice(value)
11526  * if obj:
11527  */
11528  goto __pyx_L4;
11529  }
11530 
11531  /* "View.MemoryView":429
11532  * self.setitem_slice_assign_scalar(self[index], value)
11533  * else:
11534  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11535  *
11536  * cdef is_slice(self, obj):
11537  */
11538  /*else*/ {
11539  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11540  __Pyx_GOTREF(__pyx_t_2);
11541  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11542  }
11543  __pyx_L4:;
11544 
11545  /* "View.MemoryView":416
11546  * return self.convert_item_to_object(itemp)
11547  *
11548  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11549  * if self.view.readonly:
11550  * raise TypeError("Cannot assign to read-only memoryview")
11551  */
11552 
11553  /* function exit code */
11554  __pyx_r = 0;
11555  goto __pyx_L0;
11556  __pyx_L1_error:;
11557  __Pyx_XDECREF(__pyx_t_2);
11558  __Pyx_XDECREF(__pyx_t_3);
11559  __Pyx_XDECREF(__pyx_t_4);
11560  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11561  __pyx_r = -1;
11562  __pyx_L0:;
11563  __Pyx_XDECREF(__pyx_v_have_slices);
11564  __Pyx_XDECREF(__pyx_v_obj);
11565  __Pyx_XDECREF(__pyx_v_index);
11566  __Pyx_RefNannyFinishContext();
11567  return __pyx_r;
11568 }
11569 
11570 /* "View.MemoryView":431
11571  * self.setitem_indexed(index, value)
11572  *
11573  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11574  * if not isinstance(obj, memoryview):
11575  * try:
11576  */
11577 
11578 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11579  PyObject *__pyx_r = NULL;
11580  __Pyx_RefNannyDeclarations
11581  int __pyx_t_1;
11582  int __pyx_t_2;
11583  PyObject *__pyx_t_3 = NULL;
11584  PyObject *__pyx_t_4 = NULL;
11585  PyObject *__pyx_t_5 = NULL;
11586  PyObject *__pyx_t_6 = NULL;
11587  PyObject *__pyx_t_7 = NULL;
11588  PyObject *__pyx_t_8 = NULL;
11589  int __pyx_t_9;
11590  int __pyx_lineno = 0;
11591  const char *__pyx_filename = NULL;
11592  int __pyx_clineno = 0;
11593  __Pyx_RefNannySetupContext("is_slice", 0);
11594  __Pyx_INCREF(__pyx_v_obj);
11595 
11596  /* "View.MemoryView":432
11597  *
11598  * cdef is_slice(self, obj):
11599  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11600  * try:
11601  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11602  */
11603  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11604  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11605  if (__pyx_t_2) {
11606 
11607  /* "View.MemoryView":433
11608  * cdef is_slice(self, obj):
11609  * if not isinstance(obj, memoryview):
11610  * try: # <<<<<<<<<<<<<<
11611  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11612  * self.dtype_is_object)
11613  */
11614  {
11615  __Pyx_PyThreadState_declare
11616  __Pyx_PyThreadState_assign
11617  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11618  __Pyx_XGOTREF(__pyx_t_3);
11619  __Pyx_XGOTREF(__pyx_t_4);
11620  __Pyx_XGOTREF(__pyx_t_5);
11621  /*try:*/ {
11622 
11623  /* "View.MemoryView":434
11624  * if not isinstance(obj, memoryview):
11625  * try:
11626  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11627  * self.dtype_is_object)
11628  * except TypeError:
11629  */
11630  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11631  __Pyx_GOTREF(__pyx_t_6);
11632 
11633  /* "View.MemoryView":435
11634  * try:
11635  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11636  * self.dtype_is_object) # <<<<<<<<<<<<<<
11637  * except TypeError:
11638  * return None
11639  */
11640  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11641  __Pyx_GOTREF(__pyx_t_7);
11642 
11643  /* "View.MemoryView":434
11644  * if not isinstance(obj, memoryview):
11645  * try:
11646  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11647  * self.dtype_is_object)
11648  * except TypeError:
11649  */
11650  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11651  __Pyx_GOTREF(__pyx_t_8);
11652  __Pyx_INCREF(__pyx_v_obj);
11653  __Pyx_GIVEREF(__pyx_v_obj);
11654  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11655  __Pyx_GIVEREF(__pyx_t_6);
11656  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11657  __Pyx_GIVEREF(__pyx_t_7);
11658  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11659  __pyx_t_6 = 0;
11660  __pyx_t_7 = 0;
11661  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11662  __Pyx_GOTREF(__pyx_t_7);
11663  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11664  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11665  __pyx_t_7 = 0;
11666 
11667  /* "View.MemoryView":433
11668  * cdef is_slice(self, obj):
11669  * if not isinstance(obj, memoryview):
11670  * try: # <<<<<<<<<<<<<<
11671  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11672  * self.dtype_is_object)
11673  */
11674  }
11675  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11676  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11677  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11678  goto __pyx_L9_try_end;
11679  __pyx_L4_error:;
11680  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11681  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11682  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11683 
11684  /* "View.MemoryView":436
11685  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11686  * self.dtype_is_object)
11687  * except TypeError: # <<<<<<<<<<<<<<
11688  * return None
11689  *
11690  */
11691  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11692  if (__pyx_t_9) {
11693  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11694  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11695  __Pyx_GOTREF(__pyx_t_7);
11696  __Pyx_GOTREF(__pyx_t_8);
11697  __Pyx_GOTREF(__pyx_t_6);
11698 
11699  /* "View.MemoryView":437
11700  * self.dtype_is_object)
11701  * except TypeError:
11702  * return None # <<<<<<<<<<<<<<
11703  *
11704  * return obj
11705  */
11706  __Pyx_XDECREF(__pyx_r);
11707  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11708  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11709  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11710  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11711  goto __pyx_L7_except_return;
11712  }
11713  goto __pyx_L6_except_error;
11714  __pyx_L6_except_error:;
11715 
11716  /* "View.MemoryView":433
11717  * cdef is_slice(self, obj):
11718  * if not isinstance(obj, memoryview):
11719  * try: # <<<<<<<<<<<<<<
11720  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11721  * self.dtype_is_object)
11722  */
11723  __Pyx_XGIVEREF(__pyx_t_3);
11724  __Pyx_XGIVEREF(__pyx_t_4);
11725  __Pyx_XGIVEREF(__pyx_t_5);
11726  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11727  goto __pyx_L1_error;
11728  __pyx_L7_except_return:;
11729  __Pyx_XGIVEREF(__pyx_t_3);
11730  __Pyx_XGIVEREF(__pyx_t_4);
11731  __Pyx_XGIVEREF(__pyx_t_5);
11732  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11733  goto __pyx_L0;
11734  __pyx_L9_try_end:;
11735  }
11736 
11737  /* "View.MemoryView":432
11738  *
11739  * cdef is_slice(self, obj):
11740  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11741  * try:
11742  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11743  */
11744  }
11745 
11746  /* "View.MemoryView":439
11747  * return None
11748  *
11749  * return obj # <<<<<<<<<<<<<<
11750  *
11751  * cdef setitem_slice_assignment(self, dst, src):
11752  */
11753  __Pyx_XDECREF(__pyx_r);
11754  __Pyx_INCREF(__pyx_v_obj);
11755  __pyx_r = __pyx_v_obj;
11756  goto __pyx_L0;
11757 
11758  /* "View.MemoryView":431
11759  * self.setitem_indexed(index, value)
11760  *
11761  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11762  * if not isinstance(obj, memoryview):
11763  * try:
11764  */
11765 
11766  /* function exit code */
11767  __pyx_L1_error:;
11768  __Pyx_XDECREF(__pyx_t_6);
11769  __Pyx_XDECREF(__pyx_t_7);
11770  __Pyx_XDECREF(__pyx_t_8);
11771  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11772  __pyx_r = 0;
11773  __pyx_L0:;
11774  __Pyx_XDECREF(__pyx_v_obj);
11775  __Pyx_XGIVEREF(__pyx_r);
11776  __Pyx_RefNannyFinishContext();
11777  return __pyx_r;
11778 }
11779 
11780 /* "View.MemoryView":441
11781  * return obj
11782  *
11783  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11784  * cdef __Pyx_memviewslice dst_slice
11785  * cdef __Pyx_memviewslice src_slice
11786  */
11787 
11788 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11789  __Pyx_memviewslice __pyx_v_dst_slice;
11790  __Pyx_memviewslice __pyx_v_src_slice;
11791  PyObject *__pyx_r = NULL;
11792  __Pyx_RefNannyDeclarations
11793  __Pyx_memviewslice *__pyx_t_1;
11794  __Pyx_memviewslice *__pyx_t_2;
11795  PyObject *__pyx_t_3 = NULL;
11796  int __pyx_t_4;
11797  int __pyx_t_5;
11798  int __pyx_t_6;
11799  int __pyx_lineno = 0;
11800  const char *__pyx_filename = NULL;
11801  int __pyx_clineno = 0;
11802  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11803 
11804  /* "View.MemoryView":445
11805  * cdef __Pyx_memviewslice src_slice
11806  *
11807  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11808  * get_slice_from_memview(dst, &dst_slice)[0],
11809  * src.ndim, dst.ndim, self.dtype_is_object)
11810  */
11811  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11812  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
11813 
11814  /* "View.MemoryView":446
11815  *
11816  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11817  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11818  * src.ndim, dst.ndim, self.dtype_is_object)
11819  *
11820  */
11821  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11822  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
11823 
11824  /* "View.MemoryView":447
11825  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11826  * get_slice_from_memview(dst, &dst_slice)[0],
11827  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11828  *
11829  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11830  */
11831  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11832  __Pyx_GOTREF(__pyx_t_3);
11833  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11834  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11835  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11836  __Pyx_GOTREF(__pyx_t_3);
11837  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11838  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11839 
11840  /* "View.MemoryView":445
11841  * cdef __Pyx_memviewslice src_slice
11842  *
11843  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11844  * get_slice_from_memview(dst, &dst_slice)[0],
11845  * src.ndim, dst.ndim, self.dtype_is_object)
11846  */
11847  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
11848 
11849  /* "View.MemoryView":441
11850  * return obj
11851  *
11852  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11853  * cdef __Pyx_memviewslice dst_slice
11854  * cdef __Pyx_memviewslice src_slice
11855  */
11856 
11857  /* function exit code */
11858  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11859  goto __pyx_L0;
11860  __pyx_L1_error:;
11861  __Pyx_XDECREF(__pyx_t_3);
11862  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11863  __pyx_r = 0;
11864  __pyx_L0:;
11865  __Pyx_XGIVEREF(__pyx_r);
11866  __Pyx_RefNannyFinishContext();
11867  return __pyx_r;
11868 }
11869 
11870 /* "View.MemoryView":449
11871  * src.ndim, dst.ndim, self.dtype_is_object)
11872  *
11873  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11874  * cdef int array[128]
11875  * cdef void *tmp = NULL
11876  */
11877 
11878 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11879  int __pyx_v_array[0x80];
11880  void *__pyx_v_tmp;
11881  void *__pyx_v_item;
11882  __Pyx_memviewslice *__pyx_v_dst_slice;
11883  __Pyx_memviewslice __pyx_v_tmp_slice;
11884  PyObject *__pyx_r = NULL;
11885  __Pyx_RefNannyDeclarations
11886  __Pyx_memviewslice *__pyx_t_1;
11887  int __pyx_t_2;
11888  PyObject *__pyx_t_3 = NULL;
11889  int __pyx_t_4;
11890  int __pyx_t_5;
11891  char const *__pyx_t_6;
11892  PyObject *__pyx_t_7 = NULL;
11893  PyObject *__pyx_t_8 = NULL;
11894  PyObject *__pyx_t_9 = NULL;
11895  PyObject *__pyx_t_10 = NULL;
11896  PyObject *__pyx_t_11 = NULL;
11897  PyObject *__pyx_t_12 = NULL;
11898  int __pyx_lineno = 0;
11899  const char *__pyx_filename = NULL;
11900  int __pyx_clineno = 0;
11901  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11902 
11903  /* "View.MemoryView":451
11904  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11905  * cdef int array[128]
11906  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11907  * cdef void *item
11908  *
11909  */
11910  __pyx_v_tmp = NULL;
11911 
11912  /* "View.MemoryView":456
11913  * cdef __Pyx_memviewslice *dst_slice
11914  * cdef __Pyx_memviewslice tmp_slice
11915  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11916  *
11917  * if <size_t>self.view.itemsize > sizeof(array):
11918  */
11919  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
11920  __pyx_v_dst_slice = __pyx_t_1;
11921 
11922  /* "View.MemoryView":458
11923  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11924  *
11925  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11926  * tmp = PyMem_Malloc(self.view.itemsize)
11927  * if tmp == NULL:
11928  */
11929  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11930  if (__pyx_t_2) {
11931 
11932  /* "View.MemoryView":459
11933  *
11934  * if <size_t>self.view.itemsize > sizeof(array):
11935  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11936  * if tmp == NULL:
11937  * raise MemoryError
11938  */
11939  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11940 
11941  /* "View.MemoryView":460
11942  * if <size_t>self.view.itemsize > sizeof(array):
11943  * tmp = PyMem_Malloc(self.view.itemsize)
11944  * if tmp == NULL: # <<<<<<<<<<<<<<
11945  * raise MemoryError
11946  * item = tmp
11947  */
11948  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11949  if (unlikely(__pyx_t_2)) {
11950 
11951  /* "View.MemoryView":461
11952  * tmp = PyMem_Malloc(self.view.itemsize)
11953  * if tmp == NULL:
11954  * raise MemoryError # <<<<<<<<<<<<<<
11955  * item = tmp
11956  * else:
11957  */
11958  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11959 
11960  /* "View.MemoryView":460
11961  * if <size_t>self.view.itemsize > sizeof(array):
11962  * tmp = PyMem_Malloc(self.view.itemsize)
11963  * if tmp == NULL: # <<<<<<<<<<<<<<
11964  * raise MemoryError
11965  * item = tmp
11966  */
11967  }
11968 
11969  /* "View.MemoryView":462
11970  * if tmp == NULL:
11971  * raise MemoryError
11972  * item = tmp # <<<<<<<<<<<<<<
11973  * else:
11974  * item = <void *> array
11975  */
11976  __pyx_v_item = __pyx_v_tmp;
11977 
11978  /* "View.MemoryView":458
11979  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11980  *
11981  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11982  * tmp = PyMem_Malloc(self.view.itemsize)
11983  * if tmp == NULL:
11984  */
11985  goto __pyx_L3;
11986  }
11987 
11988  /* "View.MemoryView":464
11989  * item = tmp
11990  * else:
11991  * item = <void *> array # <<<<<<<<<<<<<<
11992  *
11993  * try:
11994  */
11995  /*else*/ {
11996  __pyx_v_item = ((void *)__pyx_v_array);
11997  }
11998  __pyx_L3:;
11999 
12000  /* "View.MemoryView":466
12001  * item = <void *> array
12002  *
12003  * try: # <<<<<<<<<<<<<<
12004  * if self.dtype_is_object:
12005  * (<PyObject **> item)[0] = <PyObject *> value
12006  */
12007  /*try:*/ {
12008 
12009  /* "View.MemoryView":467
12010  *
12011  * try:
12012  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12013  * (<PyObject **> item)[0] = <PyObject *> value
12014  * else:
12015  */
12016  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12017  if (__pyx_t_2) {
12018 
12019  /* "View.MemoryView":468
12020  * try:
12021  * if self.dtype_is_object:
12022  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12023  * else:
12024  * self.assign_item_from_object(<char *> item, value)
12025  */
12026  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12027 
12028  /* "View.MemoryView":467
12029  *
12030  * try:
12031  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12032  * (<PyObject **> item)[0] = <PyObject *> value
12033  * else:
12034  */
12035  goto __pyx_L8;
12036  }
12037 
12038  /* "View.MemoryView":470
12039  * (<PyObject **> item)[0] = <PyObject *> value
12040  * else:
12041  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12042  *
12043  *
12044  */
12045  /*else*/ {
12046  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
12047  __Pyx_GOTREF(__pyx_t_3);
12048  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12049  }
12050  __pyx_L8:;
12051 
12052  /* "View.MemoryView":474
12053  *
12054  *
12055  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12056  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12057  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12058  */
12059  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12060  if (__pyx_t_2) {
12061 
12062  /* "View.MemoryView":475
12063  *
12064  * if self.view.suboffsets != NULL:
12065  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12066  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12067  * item, self.dtype_is_object)
12068  */
12069  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
12070  __Pyx_GOTREF(__pyx_t_3);
12071  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12072 
12073  /* "View.MemoryView":474
12074  *
12075  *
12076  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12077  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12078  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12079  */
12080  }
12081 
12082  /* "View.MemoryView":476
12083  * if self.view.suboffsets != NULL:
12084  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12085  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12086  * item, self.dtype_is_object)
12087  * finally:
12088  */
12089  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12090  }
12091 
12092  /* "View.MemoryView":479
12093  * item, self.dtype_is_object)
12094  * finally:
12095  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12096  *
12097  * cdef setitem_indexed(self, index, value):
12098  */
12099  /*finally:*/ {
12100  /*normal exit:*/{
12101  PyMem_Free(__pyx_v_tmp);
12102  goto __pyx_L7;
12103  }
12104  __pyx_L6_error:;
12105  /*exception exit:*/{
12106  __Pyx_PyThreadState_declare
12107  __Pyx_PyThreadState_assign
12108  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12109  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12110  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12111  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
12112  __Pyx_XGOTREF(__pyx_t_7);
12113  __Pyx_XGOTREF(__pyx_t_8);
12114  __Pyx_XGOTREF(__pyx_t_9);
12115  __Pyx_XGOTREF(__pyx_t_10);
12116  __Pyx_XGOTREF(__pyx_t_11);
12117  __Pyx_XGOTREF(__pyx_t_12);
12118  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12119  {
12120  PyMem_Free(__pyx_v_tmp);
12121  }
12122  if (PY_MAJOR_VERSION >= 3) {
12123  __Pyx_XGIVEREF(__pyx_t_10);
12124  __Pyx_XGIVEREF(__pyx_t_11);
12125  __Pyx_XGIVEREF(__pyx_t_12);
12126  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12127  }
12128  __Pyx_XGIVEREF(__pyx_t_7);
12129  __Pyx_XGIVEREF(__pyx_t_8);
12130  __Pyx_XGIVEREF(__pyx_t_9);
12131  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12132  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12133  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12134  goto __pyx_L1_error;
12135  }
12136  __pyx_L7:;
12137  }
12138 
12139  /* "View.MemoryView":449
12140  * src.ndim, dst.ndim, self.dtype_is_object)
12141  *
12142  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12143  * cdef int array[128]
12144  * cdef void *tmp = NULL
12145  */
12146 
12147  /* function exit code */
12148  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12149  goto __pyx_L0;
12150  __pyx_L1_error:;
12151  __Pyx_XDECREF(__pyx_t_3);
12152  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12153  __pyx_r = 0;
12154  __pyx_L0:;
12155  __Pyx_XGIVEREF(__pyx_r);
12156  __Pyx_RefNannyFinishContext();
12157  return __pyx_r;
12158 }
12159 
12160 /* "View.MemoryView":481
12161  * PyMem_Free(tmp)
12162  *
12163  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12164  * cdef char *itemp = self.get_item_pointer(index)
12165  * self.assign_item_from_object(itemp, value)
12166  */
12167 
12168 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12169  char *__pyx_v_itemp;
12170  PyObject *__pyx_r = NULL;
12171  __Pyx_RefNannyDeclarations
12172  char *__pyx_t_1;
12173  PyObject *__pyx_t_2 = NULL;
12174  int __pyx_lineno = 0;
12175  const char *__pyx_filename = NULL;
12176  int __pyx_clineno = 0;
12177  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12178 
12179  /* "View.MemoryView":482
12180  *
12181  * cdef setitem_indexed(self, index, value):
12182  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12183  * self.assign_item_from_object(itemp, value)
12184  *
12185  */
12186  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12187  __pyx_v_itemp = __pyx_t_1;
12188 
12189  /* "View.MemoryView":483
12190  * cdef setitem_indexed(self, index, value):
12191  * cdef char *itemp = self.get_item_pointer(index)
12192  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12193  *
12194  * cdef convert_item_to_object(self, char *itemp):
12195  */
12196  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12197  __Pyx_GOTREF(__pyx_t_2);
12198  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12199 
12200  /* "View.MemoryView":481
12201  * PyMem_Free(tmp)
12202  *
12203  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12204  * cdef char *itemp = self.get_item_pointer(index)
12205  * self.assign_item_from_object(itemp, value)
12206  */
12207 
12208  /* function exit code */
12209  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12210  goto __pyx_L0;
12211  __pyx_L1_error:;
12212  __Pyx_XDECREF(__pyx_t_2);
12213  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12214  __pyx_r = 0;
12215  __pyx_L0:;
12216  __Pyx_XGIVEREF(__pyx_r);
12217  __Pyx_RefNannyFinishContext();
12218  return __pyx_r;
12219 }
12220 
12221 /* "View.MemoryView":485
12222  * self.assign_item_from_object(itemp, value)
12223  *
12224  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12225  * """Only used if instantiated manually by the user, or if Cython doesn't
12226  * know how to convert the type"""
12227  */
12228 
12229 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12230  PyObject *__pyx_v_struct = NULL;
12231  PyObject *__pyx_v_bytesitem = 0;
12232  PyObject *__pyx_v_result = NULL;
12233  PyObject *__pyx_r = NULL;
12234  __Pyx_RefNannyDeclarations
12235  PyObject *__pyx_t_1 = NULL;
12236  PyObject *__pyx_t_2 = NULL;
12237  PyObject *__pyx_t_3 = NULL;
12238  PyObject *__pyx_t_4 = NULL;
12239  PyObject *__pyx_t_5 = NULL;
12240  PyObject *__pyx_t_6 = NULL;
12241  PyObject *__pyx_t_7 = NULL;
12242  int __pyx_t_8;
12243  PyObject *__pyx_t_9 = NULL;
12244  size_t __pyx_t_10;
12245  int __pyx_t_11;
12246  int __pyx_lineno = 0;
12247  const char *__pyx_filename = NULL;
12248  int __pyx_clineno = 0;
12249  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12250 
12251  /* "View.MemoryView":488
12252  * """Only used if instantiated manually by the user, or if Cython doesn't
12253  * know how to convert the type"""
12254  * import struct # <<<<<<<<<<<<<<
12255  * cdef bytes bytesitem
12256  *
12257  */
12258  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12259  __Pyx_GOTREF(__pyx_t_1);
12260  __pyx_v_struct = __pyx_t_1;
12261  __pyx_t_1 = 0;
12262 
12263  /* "View.MemoryView":491
12264  * cdef bytes bytesitem
12265  *
12266  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12267  * try:
12268  * result = struct.unpack(self.view.format, bytesitem)
12269  */
12270  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12271  __Pyx_GOTREF(__pyx_t_1);
12272  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12273  __pyx_t_1 = 0;
12274 
12275  /* "View.MemoryView":492
12276  *
12277  * bytesitem = itemp[:self.view.itemsize]
12278  * try: # <<<<<<<<<<<<<<
12279  * result = struct.unpack(self.view.format, bytesitem)
12280  * except struct.error:
12281  */
12282  {
12283  __Pyx_PyThreadState_declare
12284  __Pyx_PyThreadState_assign
12285  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12286  __Pyx_XGOTREF(__pyx_t_2);
12287  __Pyx_XGOTREF(__pyx_t_3);
12288  __Pyx_XGOTREF(__pyx_t_4);
12289  /*try:*/ {
12290 
12291  /* "View.MemoryView":493
12292  * bytesitem = itemp[:self.view.itemsize]
12293  * try:
12294  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12295  * except struct.error:
12296  * raise ValueError("Unable to convert item to object")
12297  */
12298  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12299  __Pyx_GOTREF(__pyx_t_5);
12300  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12301  __Pyx_GOTREF(__pyx_t_6);
12302  __pyx_t_7 = NULL;
12303  __pyx_t_8 = 0;
12304  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12305  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12306  if (likely(__pyx_t_7)) {
12307  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12308  __Pyx_INCREF(__pyx_t_7);
12309  __Pyx_INCREF(function);
12310  __Pyx_DECREF_SET(__pyx_t_5, function);
12311  __pyx_t_8 = 1;
12312  }
12313  }
12314  #if CYTHON_FAST_PYCALL
12315  if (PyFunction_Check(__pyx_t_5)) {
12316  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12317  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12318  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12319  __Pyx_GOTREF(__pyx_t_1);
12320  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12321  } else
12322  #endif
12323  #if CYTHON_FAST_PYCCALL
12324  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12325  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12326  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12327  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12328  __Pyx_GOTREF(__pyx_t_1);
12329  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12330  } else
12331  #endif
12332  {
12333  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12334  __Pyx_GOTREF(__pyx_t_9);
12335  if (__pyx_t_7) {
12336  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12337  }
12338  __Pyx_GIVEREF(__pyx_t_6);
12339  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12340  __Pyx_INCREF(__pyx_v_bytesitem);
12341  __Pyx_GIVEREF(__pyx_v_bytesitem);
12342  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12343  __pyx_t_6 = 0;
12344  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12345  __Pyx_GOTREF(__pyx_t_1);
12346  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12347  }
12348  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12349  __pyx_v_result = __pyx_t_1;
12350  __pyx_t_1 = 0;
12351 
12352  /* "View.MemoryView":492
12353  *
12354  * bytesitem = itemp[:self.view.itemsize]
12355  * try: # <<<<<<<<<<<<<<
12356  * result = struct.unpack(self.view.format, bytesitem)
12357  * except struct.error:
12358  */
12359  }
12360 
12361  /* "View.MemoryView":497
12362  * raise ValueError("Unable to convert item to object")
12363  * else:
12364  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12365  * return result[0]
12366  * return result
12367  */
12368  /*else:*/ {
12369  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12370  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12371  if (__pyx_t_11) {
12372 
12373  /* "View.MemoryView":498
12374  * else:
12375  * if len(self.view.format) == 1:
12376  * return result[0] # <<<<<<<<<<<<<<
12377  * return result
12378  *
12379  */
12380  __Pyx_XDECREF(__pyx_r);
12381  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12382  __Pyx_GOTREF(__pyx_t_1);
12383  __pyx_r = __pyx_t_1;
12384  __pyx_t_1 = 0;
12385  goto __pyx_L6_except_return;
12386 
12387  /* "View.MemoryView":497
12388  * raise ValueError("Unable to convert item to object")
12389  * else:
12390  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12391  * return result[0]
12392  * return result
12393  */
12394  }
12395 
12396  /* "View.MemoryView":499
12397  * if len(self.view.format) == 1:
12398  * return result[0]
12399  * return result # <<<<<<<<<<<<<<
12400  *
12401  * cdef assign_item_from_object(self, char *itemp, object value):
12402  */
12403  __Pyx_XDECREF(__pyx_r);
12404  __Pyx_INCREF(__pyx_v_result);
12405  __pyx_r = __pyx_v_result;
12406  goto __pyx_L6_except_return;
12407  }
12408  __pyx_L3_error:;
12409  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12410  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12411  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12412  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12413  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12414 
12415  /* "View.MemoryView":494
12416  * try:
12417  * result = struct.unpack(self.view.format, bytesitem)
12418  * except struct.error: # <<<<<<<<<<<<<<
12419  * raise ValueError("Unable to convert item to object")
12420  * else:
12421  */
12422  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12423  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12424  __Pyx_GOTREF(__pyx_t_6);
12425  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12426  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12427  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12428  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12429  if (__pyx_t_8) {
12430  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12431  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12432  __Pyx_GOTREF(__pyx_t_9);
12433  __Pyx_GOTREF(__pyx_t_5);
12434  __Pyx_GOTREF(__pyx_t_1);
12435 
12436  /* "View.MemoryView":495
12437  * result = struct.unpack(self.view.format, bytesitem)
12438  * except struct.error:
12439  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12440  * else:
12441  * if len(self.view.format) == 1:
12442  */
12443  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12444  __Pyx_GOTREF(__pyx_t_6);
12445  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12446  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12447  __PYX_ERR(1, 495, __pyx_L5_except_error)
12448  }
12449  goto __pyx_L5_except_error;
12450  __pyx_L5_except_error:;
12451 
12452  /* "View.MemoryView":492
12453  *
12454  * bytesitem = itemp[:self.view.itemsize]
12455  * try: # <<<<<<<<<<<<<<
12456  * result = struct.unpack(self.view.format, bytesitem)
12457  * except struct.error:
12458  */
12459  __Pyx_XGIVEREF(__pyx_t_2);
12460  __Pyx_XGIVEREF(__pyx_t_3);
12461  __Pyx_XGIVEREF(__pyx_t_4);
12462  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12463  goto __pyx_L1_error;
12464  __pyx_L6_except_return:;
12465  __Pyx_XGIVEREF(__pyx_t_2);
12466  __Pyx_XGIVEREF(__pyx_t_3);
12467  __Pyx_XGIVEREF(__pyx_t_4);
12468  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12469  goto __pyx_L0;
12470  }
12471 
12472  /* "View.MemoryView":485
12473  * self.assign_item_from_object(itemp, value)
12474  *
12475  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12476  * """Only used if instantiated manually by the user, or if Cython doesn't
12477  * know how to convert the type"""
12478  */
12479 
12480  /* function exit code */
12481  __pyx_L1_error:;
12482  __Pyx_XDECREF(__pyx_t_1);
12483  __Pyx_XDECREF(__pyx_t_5);
12484  __Pyx_XDECREF(__pyx_t_6);
12485  __Pyx_XDECREF(__pyx_t_7);
12486  __Pyx_XDECREF(__pyx_t_9);
12487  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12488  __pyx_r = 0;
12489  __pyx_L0:;
12490  __Pyx_XDECREF(__pyx_v_struct);
12491  __Pyx_XDECREF(__pyx_v_bytesitem);
12492  __Pyx_XDECREF(__pyx_v_result);
12493  __Pyx_XGIVEREF(__pyx_r);
12494  __Pyx_RefNannyFinishContext();
12495  return __pyx_r;
12496 }
12497 
12498 /* "View.MemoryView":501
12499  * return result
12500  *
12501  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12502  * """Only used if instantiated manually by the user, or if Cython doesn't
12503  * know how to convert the type"""
12504  */
12505 
12506 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12507  PyObject *__pyx_v_struct = NULL;
12508  char __pyx_v_c;
12509  PyObject *__pyx_v_bytesvalue = 0;
12510  Py_ssize_t __pyx_v_i;
12511  PyObject *__pyx_r = NULL;
12512  __Pyx_RefNannyDeclarations
12513  PyObject *__pyx_t_1 = NULL;
12514  int __pyx_t_2;
12515  int __pyx_t_3;
12516  PyObject *__pyx_t_4 = NULL;
12517  PyObject *__pyx_t_5 = NULL;
12518  PyObject *__pyx_t_6 = NULL;
12519  int __pyx_t_7;
12520  PyObject *__pyx_t_8 = NULL;
12521  Py_ssize_t __pyx_t_9;
12522  PyObject *__pyx_t_10 = NULL;
12523  char *__pyx_t_11;
12524  char *__pyx_t_12;
12525  char *__pyx_t_13;
12526  char *__pyx_t_14;
12527  int __pyx_lineno = 0;
12528  const char *__pyx_filename = NULL;
12529  int __pyx_clineno = 0;
12530  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12531 
12532  /* "View.MemoryView":504
12533  * """Only used if instantiated manually by the user, or if Cython doesn't
12534  * know how to convert the type"""
12535  * import struct # <<<<<<<<<<<<<<
12536  * cdef char c
12537  * cdef bytes bytesvalue
12538  */
12539  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12540  __Pyx_GOTREF(__pyx_t_1);
12541  __pyx_v_struct = __pyx_t_1;
12542  __pyx_t_1 = 0;
12543 
12544  /* "View.MemoryView":509
12545  * cdef Py_ssize_t i
12546  *
12547  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12548  * bytesvalue = struct.pack(self.view.format, *value)
12549  * else:
12550  */
12551  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12552  __pyx_t_3 = (__pyx_t_2 != 0);
12553  if (__pyx_t_3) {
12554 
12555  /* "View.MemoryView":510
12556  *
12557  * if isinstance(value, tuple):
12558  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12559  * else:
12560  * bytesvalue = struct.pack(self.view.format, value)
12561  */
12562  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12563  __Pyx_GOTREF(__pyx_t_1);
12564  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12565  __Pyx_GOTREF(__pyx_t_4);
12566  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12567  __Pyx_GOTREF(__pyx_t_5);
12568  __Pyx_GIVEREF(__pyx_t_4);
12569  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12570  __pyx_t_4 = 0;
12571  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12572  __Pyx_GOTREF(__pyx_t_4);
12573  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12574  __Pyx_GOTREF(__pyx_t_6);
12575  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12576  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12577  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12578  __Pyx_GOTREF(__pyx_t_4);
12579  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12580  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12581  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12582  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12583  __pyx_t_4 = 0;
12584 
12585  /* "View.MemoryView":509
12586  * cdef Py_ssize_t i
12587  *
12588  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12589  * bytesvalue = struct.pack(self.view.format, *value)
12590  * else:
12591  */
12592  goto __pyx_L3;
12593  }
12594 
12595  /* "View.MemoryView":512
12596  * bytesvalue = struct.pack(self.view.format, *value)
12597  * else:
12598  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12599  *
12600  * for i, c in enumerate(bytesvalue):
12601  */
12602  /*else*/ {
12603  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12604  __Pyx_GOTREF(__pyx_t_6);
12605  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12606  __Pyx_GOTREF(__pyx_t_1);
12607  __pyx_t_5 = NULL;
12608  __pyx_t_7 = 0;
12609  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12610  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12611  if (likely(__pyx_t_5)) {
12612  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12613  __Pyx_INCREF(__pyx_t_5);
12614  __Pyx_INCREF(function);
12615  __Pyx_DECREF_SET(__pyx_t_6, function);
12616  __pyx_t_7 = 1;
12617  }
12618  }
12619  #if CYTHON_FAST_PYCALL
12620  if (PyFunction_Check(__pyx_t_6)) {
12621  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12622  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12623  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12624  __Pyx_GOTREF(__pyx_t_4);
12625  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12626  } else
12627  #endif
12628  #if CYTHON_FAST_PYCCALL
12629  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12630  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12631  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12632  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12633  __Pyx_GOTREF(__pyx_t_4);
12634  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12635  } else
12636  #endif
12637  {
12638  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12639  __Pyx_GOTREF(__pyx_t_8);
12640  if (__pyx_t_5) {
12641  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12642  }
12643  __Pyx_GIVEREF(__pyx_t_1);
12644  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12645  __Pyx_INCREF(__pyx_v_value);
12646  __Pyx_GIVEREF(__pyx_v_value);
12647  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12648  __pyx_t_1 = 0;
12649  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12650  __Pyx_GOTREF(__pyx_t_4);
12651  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12652  }
12653  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12654  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12655  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12656  __pyx_t_4 = 0;
12657  }
12658  __pyx_L3:;
12659 
12660  /* "View.MemoryView":514
12661  * bytesvalue = struct.pack(self.view.format, value)
12662  *
12663  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12664  * itemp[i] = c
12665  *
12666  */
12667  __pyx_t_9 = 0;
12668  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12669  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12670  __PYX_ERR(1, 514, __pyx_L1_error)
12671  }
12672  __Pyx_INCREF(__pyx_v_bytesvalue);
12673  __pyx_t_10 = __pyx_v_bytesvalue;
12674  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12675  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12676  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12677  __pyx_t_11 = __pyx_t_14;
12678  __pyx_v_c = (__pyx_t_11[0]);
12679 
12680  /* "View.MemoryView":515
12681  *
12682  * for i, c in enumerate(bytesvalue):
12683  * itemp[i] = c # <<<<<<<<<<<<<<
12684  *
12685  * @cname('getbuffer')
12686  */
12687  __pyx_v_i = __pyx_t_9;
12688 
12689  /* "View.MemoryView":514
12690  * bytesvalue = struct.pack(self.view.format, value)
12691  *
12692  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12693  * itemp[i] = c
12694  *
12695  */
12696  __pyx_t_9 = (__pyx_t_9 + 1);
12697 
12698  /* "View.MemoryView":515
12699  *
12700  * for i, c in enumerate(bytesvalue):
12701  * itemp[i] = c # <<<<<<<<<<<<<<
12702  *
12703  * @cname('getbuffer')
12704  */
12705  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12706  }
12707  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12708 
12709  /* "View.MemoryView":501
12710  * return result
12711  *
12712  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12713  * """Only used if instantiated manually by the user, or if Cython doesn't
12714  * know how to convert the type"""
12715  */
12716 
12717  /* function exit code */
12718  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12719  goto __pyx_L0;
12720  __pyx_L1_error:;
12721  __Pyx_XDECREF(__pyx_t_1);
12722  __Pyx_XDECREF(__pyx_t_4);
12723  __Pyx_XDECREF(__pyx_t_5);
12724  __Pyx_XDECREF(__pyx_t_6);
12725  __Pyx_XDECREF(__pyx_t_8);
12726  __Pyx_XDECREF(__pyx_t_10);
12727  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12728  __pyx_r = 0;
12729  __pyx_L0:;
12730  __Pyx_XDECREF(__pyx_v_struct);
12731  __Pyx_XDECREF(__pyx_v_bytesvalue);
12732  __Pyx_XGIVEREF(__pyx_r);
12733  __Pyx_RefNannyFinishContext();
12734  return __pyx_r;
12735 }
12736 
12737 /* "View.MemoryView":518
12738  *
12739  * @cname('getbuffer')
12740  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12741  * if flags & PyBUF_WRITABLE and self.view.readonly:
12742  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12743  */
12744 
12745 /* Python wrapper */
12746 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12747 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12748  int __pyx_r;
12749  __Pyx_RefNannyDeclarations
12750  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12751  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12752 
12753  /* function exit code */
12754  __Pyx_RefNannyFinishContext();
12755  return __pyx_r;
12756 }
12757 
12758 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12759  int __pyx_r;
12760  __Pyx_RefNannyDeclarations
12761  int __pyx_t_1;
12762  int __pyx_t_2;
12763  PyObject *__pyx_t_3 = NULL;
12764  Py_ssize_t *__pyx_t_4;
12765  char *__pyx_t_5;
12766  void *__pyx_t_6;
12767  int __pyx_t_7;
12768  Py_ssize_t __pyx_t_8;
12769  int __pyx_lineno = 0;
12770  const char *__pyx_filename = NULL;
12771  int __pyx_clineno = 0;
12772  if (__pyx_v_info == NULL) {
12773  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12774  return -1;
12775  }
12776  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12777  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12778  __Pyx_GIVEREF(__pyx_v_info->obj);
12779 
12780  /* "View.MemoryView":519
12781  * @cname('getbuffer')
12782  * def __getbuffer__(self, Py_buffer *info, int flags):
12783  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12784  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12785  *
12786  */
12787  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12788  if (__pyx_t_2) {
12789  } else {
12790  __pyx_t_1 = __pyx_t_2;
12791  goto __pyx_L4_bool_binop_done;
12792  }
12793  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12794  __pyx_t_1 = __pyx_t_2;
12795  __pyx_L4_bool_binop_done:;
12796  if (unlikely(__pyx_t_1)) {
12797 
12798  /* "View.MemoryView":520
12799  * def __getbuffer__(self, Py_buffer *info, int flags):
12800  * if flags & PyBUF_WRITABLE and self.view.readonly:
12801  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12802  *
12803  * if flags & PyBUF_ND:
12804  */
12805  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12806  __Pyx_GOTREF(__pyx_t_3);
12807  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12808  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12809  __PYX_ERR(1, 520, __pyx_L1_error)
12810 
12811  /* "View.MemoryView":519
12812  * @cname('getbuffer')
12813  * def __getbuffer__(self, Py_buffer *info, int flags):
12814  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12815  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12816  *
12817  */
12818  }
12819 
12820  /* "View.MemoryView":522
12821  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12822  *
12823  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12824  * info.shape = self.view.shape
12825  * else:
12826  */
12827  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12828  if (__pyx_t_1) {
12829 
12830  /* "View.MemoryView":523
12831  *
12832  * if flags & PyBUF_ND:
12833  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12834  * else:
12835  * info.shape = NULL
12836  */
12837  __pyx_t_4 = __pyx_v_self->view.shape;
12838  __pyx_v_info->shape = __pyx_t_4;
12839 
12840  /* "View.MemoryView":522
12841  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12842  *
12843  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12844  * info.shape = self.view.shape
12845  * else:
12846  */
12847  goto __pyx_L6;
12848  }
12849 
12850  /* "View.MemoryView":525
12851  * info.shape = self.view.shape
12852  * else:
12853  * info.shape = NULL # <<<<<<<<<<<<<<
12854  *
12855  * if flags & PyBUF_STRIDES:
12856  */
12857  /*else*/ {
12858  __pyx_v_info->shape = NULL;
12859  }
12860  __pyx_L6:;
12861 
12862  /* "View.MemoryView":527
12863  * info.shape = NULL
12864  *
12865  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12866  * info.strides = self.view.strides
12867  * else:
12868  */
12869  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12870  if (__pyx_t_1) {
12871 
12872  /* "View.MemoryView":528
12873  *
12874  * if flags & PyBUF_STRIDES:
12875  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12876  * else:
12877  * info.strides = NULL
12878  */
12879  __pyx_t_4 = __pyx_v_self->view.strides;
12880  __pyx_v_info->strides = __pyx_t_4;
12881 
12882  /* "View.MemoryView":527
12883  * info.shape = NULL
12884  *
12885  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12886  * info.strides = self.view.strides
12887  * else:
12888  */
12889  goto __pyx_L7;
12890  }
12891 
12892  /* "View.MemoryView":530
12893  * info.strides = self.view.strides
12894  * else:
12895  * info.strides = NULL # <<<<<<<<<<<<<<
12896  *
12897  * if flags & PyBUF_INDIRECT:
12898  */
12899  /*else*/ {
12900  __pyx_v_info->strides = NULL;
12901  }
12902  __pyx_L7:;
12903 
12904  /* "View.MemoryView":532
12905  * info.strides = NULL
12906  *
12907  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12908  * info.suboffsets = self.view.suboffsets
12909  * else:
12910  */
12911  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12912  if (__pyx_t_1) {
12913 
12914  /* "View.MemoryView":533
12915  *
12916  * if flags & PyBUF_INDIRECT:
12917  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12918  * else:
12919  * info.suboffsets = NULL
12920  */
12921  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12922  __pyx_v_info->suboffsets = __pyx_t_4;
12923 
12924  /* "View.MemoryView":532
12925  * info.strides = NULL
12926  *
12927  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12928  * info.suboffsets = self.view.suboffsets
12929  * else:
12930  */
12931  goto __pyx_L8;
12932  }
12933 
12934  /* "View.MemoryView":535
12935  * info.suboffsets = self.view.suboffsets
12936  * else:
12937  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12938  *
12939  * if flags & PyBUF_FORMAT:
12940  */
12941  /*else*/ {
12942  __pyx_v_info->suboffsets = NULL;
12943  }
12944  __pyx_L8:;
12945 
12946  /* "View.MemoryView":537
12947  * info.suboffsets = NULL
12948  *
12949  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12950  * info.format = self.view.format
12951  * else:
12952  */
12953  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12954  if (__pyx_t_1) {
12955 
12956  /* "View.MemoryView":538
12957  *
12958  * if flags & PyBUF_FORMAT:
12959  * info.format = self.view.format # <<<<<<<<<<<<<<
12960  * else:
12961  * info.format = NULL
12962  */
12963  __pyx_t_5 = __pyx_v_self->view.format;
12964  __pyx_v_info->format = __pyx_t_5;
12965 
12966  /* "View.MemoryView":537
12967  * info.suboffsets = NULL
12968  *
12969  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12970  * info.format = self.view.format
12971  * else:
12972  */
12973  goto __pyx_L9;
12974  }
12975 
12976  /* "View.MemoryView":540
12977  * info.format = self.view.format
12978  * else:
12979  * info.format = NULL # <<<<<<<<<<<<<<
12980  *
12981  * info.buf = self.view.buf
12982  */
12983  /*else*/ {
12984  __pyx_v_info->format = NULL;
12985  }
12986  __pyx_L9:;
12987 
12988  /* "View.MemoryView":542
12989  * info.format = NULL
12990  *
12991  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12992  * info.ndim = self.view.ndim
12993  * info.itemsize = self.view.itemsize
12994  */
12995  __pyx_t_6 = __pyx_v_self->view.buf;
12996  __pyx_v_info->buf = __pyx_t_6;
12997 
12998  /* "View.MemoryView":543
12999  *
13000  * info.buf = self.view.buf
13001  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13002  * info.itemsize = self.view.itemsize
13003  * info.len = self.view.len
13004  */
13005  __pyx_t_7 = __pyx_v_self->view.ndim;
13006  __pyx_v_info->ndim = __pyx_t_7;
13007 
13008  /* "View.MemoryView":544
13009  * info.buf = self.view.buf
13010  * info.ndim = self.view.ndim
13011  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13012  * info.len = self.view.len
13013  * info.readonly = self.view.readonly
13014  */
13015  __pyx_t_8 = __pyx_v_self->view.itemsize;
13016  __pyx_v_info->itemsize = __pyx_t_8;
13017 
13018  /* "View.MemoryView":545
13019  * info.ndim = self.view.ndim
13020  * info.itemsize = self.view.itemsize
13021  * info.len = self.view.len # <<<<<<<<<<<<<<
13022  * info.readonly = self.view.readonly
13023  * info.obj = self
13024  */
13025  __pyx_t_8 = __pyx_v_self->view.len;
13026  __pyx_v_info->len = __pyx_t_8;
13027 
13028  /* "View.MemoryView":546
13029  * info.itemsize = self.view.itemsize
13030  * info.len = self.view.len
13031  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13032  * info.obj = self
13033  *
13034  */
13035  __pyx_t_1 = __pyx_v_self->view.readonly;
13036  __pyx_v_info->readonly = __pyx_t_1;
13037 
13038  /* "View.MemoryView":547
13039  * info.len = self.view.len
13040  * info.readonly = self.view.readonly
13041  * info.obj = self # <<<<<<<<<<<<<<
13042  *
13043  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13044  */
13045  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13046  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13047  __Pyx_GOTREF(__pyx_v_info->obj);
13048  __Pyx_DECREF(__pyx_v_info->obj);
13049  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13050 
13051  /* "View.MemoryView":518
13052  *
13053  * @cname('getbuffer')
13054  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13055  * if flags & PyBUF_WRITABLE and self.view.readonly:
13056  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13057  */
13058 
13059  /* function exit code */
13060  __pyx_r = 0;
13061  goto __pyx_L0;
13062  __pyx_L1_error:;
13063  __Pyx_XDECREF(__pyx_t_3);
13064  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13065  __pyx_r = -1;
13066  if (__pyx_v_info->obj != NULL) {
13067  __Pyx_GOTREF(__pyx_v_info->obj);
13068  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13069  }
13070  goto __pyx_L2;
13071  __pyx_L0:;
13072  if (__pyx_v_info->obj == Py_None) {
13073  __Pyx_GOTREF(__pyx_v_info->obj);
13074  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13075  }
13076  __pyx_L2:;
13077  __Pyx_RefNannyFinishContext();
13078  return __pyx_r;
13079 }
13080 
13081 /* "View.MemoryView":553
13082  *
13083  * @property
13084  * def T(self): # <<<<<<<<<<<<<<
13085  * cdef _memoryviewslice result = memoryview_copy(self)
13086  * transpose_memslice(&result.from_slice)
13087  */
13088 
13089 /* Python wrapper */
13090 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13091 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13092  PyObject *__pyx_r = 0;
13093  __Pyx_RefNannyDeclarations
13094  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13095  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13096 
13097  /* function exit code */
13098  __Pyx_RefNannyFinishContext();
13099  return __pyx_r;
13100 }
13101 
13102 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13103  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13104  PyObject *__pyx_r = NULL;
13105  __Pyx_RefNannyDeclarations
13106  PyObject *__pyx_t_1 = NULL;
13107  int __pyx_t_2;
13108  int __pyx_lineno = 0;
13109  const char *__pyx_filename = NULL;
13110  int __pyx_clineno = 0;
13111  __Pyx_RefNannySetupContext("__get__", 0);
13112 
13113  /* "View.MemoryView":554
13114  * @property
13115  * def T(self):
13116  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13117  * transpose_memslice(&result.from_slice)
13118  * return result
13119  */
13120  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13121  __Pyx_GOTREF(__pyx_t_1);
13122  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13123  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13124  __pyx_t_1 = 0;
13125 
13126  /* "View.MemoryView":555
13127  * def T(self):
13128  * cdef _memoryviewslice result = memoryview_copy(self)
13129  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13130  * return result
13131  *
13132  */
13133  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13134 
13135  /* "View.MemoryView":556
13136  * cdef _memoryviewslice result = memoryview_copy(self)
13137  * transpose_memslice(&result.from_slice)
13138  * return result # <<<<<<<<<<<<<<
13139  *
13140  * @property
13141  */
13142  __Pyx_XDECREF(__pyx_r);
13143  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13144  __pyx_r = ((PyObject *)__pyx_v_result);
13145  goto __pyx_L0;
13146 
13147  /* "View.MemoryView":553
13148  *
13149  * @property
13150  * def T(self): # <<<<<<<<<<<<<<
13151  * cdef _memoryviewslice result = memoryview_copy(self)
13152  * transpose_memslice(&result.from_slice)
13153  */
13154 
13155  /* function exit code */
13156  __pyx_L1_error:;
13157  __Pyx_XDECREF(__pyx_t_1);
13158  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13159  __pyx_r = NULL;
13160  __pyx_L0:;
13161  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13162  __Pyx_XGIVEREF(__pyx_r);
13163  __Pyx_RefNannyFinishContext();
13164  return __pyx_r;
13165 }
13166 
13167 /* "View.MemoryView":559
13168  *
13169  * @property
13170  * def base(self): # <<<<<<<<<<<<<<
13171  * return self.obj
13172  *
13173  */
13174 
13175 /* Python wrapper */
13176 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13177 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13178  PyObject *__pyx_r = 0;
13179  __Pyx_RefNannyDeclarations
13180  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13181  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13182 
13183  /* function exit code */
13184  __Pyx_RefNannyFinishContext();
13185  return __pyx_r;
13186 }
13187 
13188 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13189  PyObject *__pyx_r = NULL;
13190  __Pyx_RefNannyDeclarations
13191  __Pyx_RefNannySetupContext("__get__", 0);
13192 
13193  /* "View.MemoryView":560
13194  * @property
13195  * def base(self):
13196  * return self.obj # <<<<<<<<<<<<<<
13197  *
13198  * @property
13199  */
13200  __Pyx_XDECREF(__pyx_r);
13201  __Pyx_INCREF(__pyx_v_self->obj);
13202  __pyx_r = __pyx_v_self->obj;
13203  goto __pyx_L0;
13204 
13205  /* "View.MemoryView":559
13206  *
13207  * @property
13208  * def base(self): # <<<<<<<<<<<<<<
13209  * return self.obj
13210  *
13211  */
13212 
13213  /* function exit code */
13214  __pyx_L0:;
13215  __Pyx_XGIVEREF(__pyx_r);
13216  __Pyx_RefNannyFinishContext();
13217  return __pyx_r;
13218 }
13219 
13220 /* "View.MemoryView":563
13221  *
13222  * @property
13223  * def shape(self): # <<<<<<<<<<<<<<
13224  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13225  *
13226  */
13227 
13228 /* Python wrapper */
13229 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13230 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13231  PyObject *__pyx_r = 0;
13232  __Pyx_RefNannyDeclarations
13233  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13234  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13235 
13236  /* function exit code */
13237  __Pyx_RefNannyFinishContext();
13238  return __pyx_r;
13239 }
13240 
13241 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13242  Py_ssize_t __pyx_v_length;
13243  PyObject *__pyx_r = NULL;
13244  __Pyx_RefNannyDeclarations
13245  PyObject *__pyx_t_1 = NULL;
13246  Py_ssize_t *__pyx_t_2;
13247  Py_ssize_t *__pyx_t_3;
13248  Py_ssize_t *__pyx_t_4;
13249  PyObject *__pyx_t_5 = NULL;
13250  int __pyx_lineno = 0;
13251  const char *__pyx_filename = NULL;
13252  int __pyx_clineno = 0;
13253  __Pyx_RefNannySetupContext("__get__", 0);
13254 
13255  /* "View.MemoryView":564
13256  * @property
13257  * def shape(self):
13258  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13259  *
13260  * @property
13261  */
13262  __Pyx_XDECREF(__pyx_r);
13263  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13264  __Pyx_GOTREF(__pyx_t_1);
13265  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13266  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13267  __pyx_t_2 = __pyx_t_4;
13268  __pyx_v_length = (__pyx_t_2[0]);
13269  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13270  __Pyx_GOTREF(__pyx_t_5);
13271  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13272  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13273  }
13274  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13275  __Pyx_GOTREF(__pyx_t_5);
13276  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13277  __pyx_r = __pyx_t_5;
13278  __pyx_t_5 = 0;
13279  goto __pyx_L0;
13280 
13281  /* "View.MemoryView":563
13282  *
13283  * @property
13284  * def shape(self): # <<<<<<<<<<<<<<
13285  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13286  *
13287  */
13288 
13289  /* function exit code */
13290  __pyx_L1_error:;
13291  __Pyx_XDECREF(__pyx_t_1);
13292  __Pyx_XDECREF(__pyx_t_5);
13293  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13294  __pyx_r = NULL;
13295  __pyx_L0:;
13296  __Pyx_XGIVEREF(__pyx_r);
13297  __Pyx_RefNannyFinishContext();
13298  return __pyx_r;
13299 }
13300 
13301 /* "View.MemoryView":567
13302  *
13303  * @property
13304  * def strides(self): # <<<<<<<<<<<<<<
13305  * if self.view.strides == NULL:
13306  *
13307  */
13308 
13309 /* Python wrapper */
13310 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13311 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13312  PyObject *__pyx_r = 0;
13313  __Pyx_RefNannyDeclarations
13314  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13315  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13316 
13317  /* function exit code */
13318  __Pyx_RefNannyFinishContext();
13319  return __pyx_r;
13320 }
13321 
13322 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13323  Py_ssize_t __pyx_v_stride;
13324  PyObject *__pyx_r = NULL;
13325  __Pyx_RefNannyDeclarations
13326  int __pyx_t_1;
13327  PyObject *__pyx_t_2 = NULL;
13328  Py_ssize_t *__pyx_t_3;
13329  Py_ssize_t *__pyx_t_4;
13330  Py_ssize_t *__pyx_t_5;
13331  PyObject *__pyx_t_6 = NULL;
13332  int __pyx_lineno = 0;
13333  const char *__pyx_filename = NULL;
13334  int __pyx_clineno = 0;
13335  __Pyx_RefNannySetupContext("__get__", 0);
13336 
13337  /* "View.MemoryView":568
13338  * @property
13339  * def strides(self):
13340  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13341  *
13342  * raise ValueError("Buffer view does not expose strides")
13343  */
13344  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13345  if (unlikely(__pyx_t_1)) {
13346 
13347  /* "View.MemoryView":570
13348  * if self.view.strides == NULL:
13349  *
13350  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13351  *
13352  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13353  */
13354  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13355  __Pyx_GOTREF(__pyx_t_2);
13356  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13357  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13358  __PYX_ERR(1, 570, __pyx_L1_error)
13359 
13360  /* "View.MemoryView":568
13361  * @property
13362  * def strides(self):
13363  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13364  *
13365  * raise ValueError("Buffer view does not expose strides")
13366  */
13367  }
13368 
13369  /* "View.MemoryView":572
13370  * raise ValueError("Buffer view does not expose strides")
13371  *
13372  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13373  *
13374  * @property
13375  */
13376  __Pyx_XDECREF(__pyx_r);
13377  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13378  __Pyx_GOTREF(__pyx_t_2);
13379  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13380  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13381  __pyx_t_3 = __pyx_t_5;
13382  __pyx_v_stride = (__pyx_t_3[0]);
13383  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13384  __Pyx_GOTREF(__pyx_t_6);
13385  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13386  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13387  }
13388  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13389  __Pyx_GOTREF(__pyx_t_6);
13390  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13391  __pyx_r = __pyx_t_6;
13392  __pyx_t_6 = 0;
13393  goto __pyx_L0;
13394 
13395  /* "View.MemoryView":567
13396  *
13397  * @property
13398  * def strides(self): # <<<<<<<<<<<<<<
13399  * if self.view.strides == NULL:
13400  *
13401  */
13402 
13403  /* function exit code */
13404  __pyx_L1_error:;
13405  __Pyx_XDECREF(__pyx_t_2);
13406  __Pyx_XDECREF(__pyx_t_6);
13407  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13408  __pyx_r = NULL;
13409  __pyx_L0:;
13410  __Pyx_XGIVEREF(__pyx_r);
13411  __Pyx_RefNannyFinishContext();
13412  return __pyx_r;
13413 }
13414 
13415 /* "View.MemoryView":575
13416  *
13417  * @property
13418  * def suboffsets(self): # <<<<<<<<<<<<<<
13419  * if self.view.suboffsets == NULL:
13420  * return (-1,) * self.view.ndim
13421  */
13422 
13423 /* Python wrapper */
13424 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13425 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13426  PyObject *__pyx_r = 0;
13427  __Pyx_RefNannyDeclarations
13428  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13429  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13430 
13431  /* function exit code */
13432  __Pyx_RefNannyFinishContext();
13433  return __pyx_r;
13434 }
13435 
13436 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13437  Py_ssize_t __pyx_v_suboffset;
13438  PyObject *__pyx_r = NULL;
13439  __Pyx_RefNannyDeclarations
13440  int __pyx_t_1;
13441  PyObject *__pyx_t_2 = NULL;
13442  PyObject *__pyx_t_3 = NULL;
13443  Py_ssize_t *__pyx_t_4;
13444  Py_ssize_t *__pyx_t_5;
13445  Py_ssize_t *__pyx_t_6;
13446  int __pyx_lineno = 0;
13447  const char *__pyx_filename = NULL;
13448  int __pyx_clineno = 0;
13449  __Pyx_RefNannySetupContext("__get__", 0);
13450 
13451  /* "View.MemoryView":576
13452  * @property
13453  * def suboffsets(self):
13454  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13455  * return (-1,) * self.view.ndim
13456  *
13457  */
13458  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13459  if (__pyx_t_1) {
13460 
13461  /* "View.MemoryView":577
13462  * def suboffsets(self):
13463  * if self.view.suboffsets == NULL:
13464  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13465  *
13466  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13467  */
13468  __Pyx_XDECREF(__pyx_r);
13469  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13470  __Pyx_GOTREF(__pyx_t_2);
13471  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13472  __Pyx_GOTREF(__pyx_t_3);
13473  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13474  __pyx_r = __pyx_t_3;
13475  __pyx_t_3 = 0;
13476  goto __pyx_L0;
13477 
13478  /* "View.MemoryView":576
13479  * @property
13480  * def suboffsets(self):
13481  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13482  * return (-1,) * self.view.ndim
13483  *
13484  */
13485  }
13486 
13487  /* "View.MemoryView":579
13488  * return (-1,) * self.view.ndim
13489  *
13490  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13491  *
13492  * @property
13493  */
13494  __Pyx_XDECREF(__pyx_r);
13495  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13496  __Pyx_GOTREF(__pyx_t_3);
13497  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13498  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13499  __pyx_t_4 = __pyx_t_6;
13500  __pyx_v_suboffset = (__pyx_t_4[0]);
13501  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13502  __Pyx_GOTREF(__pyx_t_2);
13503  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13504  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13505  }
13506  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13507  __Pyx_GOTREF(__pyx_t_2);
13508  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13509  __pyx_r = __pyx_t_2;
13510  __pyx_t_2 = 0;
13511  goto __pyx_L0;
13512 
13513  /* "View.MemoryView":575
13514  *
13515  * @property
13516  * def suboffsets(self): # <<<<<<<<<<<<<<
13517  * if self.view.suboffsets == NULL:
13518  * return (-1,) * self.view.ndim
13519  */
13520 
13521  /* function exit code */
13522  __pyx_L1_error:;
13523  __Pyx_XDECREF(__pyx_t_2);
13524  __Pyx_XDECREF(__pyx_t_3);
13525  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13526  __pyx_r = NULL;
13527  __pyx_L0:;
13528  __Pyx_XGIVEREF(__pyx_r);
13529  __Pyx_RefNannyFinishContext();
13530  return __pyx_r;
13531 }
13532 
13533 /* "View.MemoryView":582
13534  *
13535  * @property
13536  * def ndim(self): # <<<<<<<<<<<<<<
13537  * return self.view.ndim
13538  *
13539  */
13540 
13541 /* Python wrapper */
13542 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13543 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13544  PyObject *__pyx_r = 0;
13545  __Pyx_RefNannyDeclarations
13546  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13547  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13548 
13549  /* function exit code */
13550  __Pyx_RefNannyFinishContext();
13551  return __pyx_r;
13552 }
13553 
13554 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13555  PyObject *__pyx_r = NULL;
13556  __Pyx_RefNannyDeclarations
13557  PyObject *__pyx_t_1 = NULL;
13558  int __pyx_lineno = 0;
13559  const char *__pyx_filename = NULL;
13560  int __pyx_clineno = 0;
13561  __Pyx_RefNannySetupContext("__get__", 0);
13562 
13563  /* "View.MemoryView":583
13564  * @property
13565  * def ndim(self):
13566  * return self.view.ndim # <<<<<<<<<<<<<<
13567  *
13568  * @property
13569  */
13570  __Pyx_XDECREF(__pyx_r);
13571  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13572  __Pyx_GOTREF(__pyx_t_1);
13573  __pyx_r = __pyx_t_1;
13574  __pyx_t_1 = 0;
13575  goto __pyx_L0;
13576 
13577  /* "View.MemoryView":582
13578  *
13579  * @property
13580  * def ndim(self): # <<<<<<<<<<<<<<
13581  * return self.view.ndim
13582  *
13583  */
13584 
13585  /* function exit code */
13586  __pyx_L1_error:;
13587  __Pyx_XDECREF(__pyx_t_1);
13588  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13589  __pyx_r = NULL;
13590  __pyx_L0:;
13591  __Pyx_XGIVEREF(__pyx_r);
13592  __Pyx_RefNannyFinishContext();
13593  return __pyx_r;
13594 }
13595 
13596 /* "View.MemoryView":586
13597  *
13598  * @property
13599  * def itemsize(self): # <<<<<<<<<<<<<<
13600  * return self.view.itemsize
13601  *
13602  */
13603 
13604 /* Python wrapper */
13605 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13606 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13607  PyObject *__pyx_r = 0;
13608  __Pyx_RefNannyDeclarations
13609  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13610  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13611 
13612  /* function exit code */
13613  __Pyx_RefNannyFinishContext();
13614  return __pyx_r;
13615 }
13616 
13617 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13618  PyObject *__pyx_r = NULL;
13619  __Pyx_RefNannyDeclarations
13620  PyObject *__pyx_t_1 = NULL;
13621  int __pyx_lineno = 0;
13622  const char *__pyx_filename = NULL;
13623  int __pyx_clineno = 0;
13624  __Pyx_RefNannySetupContext("__get__", 0);
13625 
13626  /* "View.MemoryView":587
13627  * @property
13628  * def itemsize(self):
13629  * return self.view.itemsize # <<<<<<<<<<<<<<
13630  *
13631  * @property
13632  */
13633  __Pyx_XDECREF(__pyx_r);
13634  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13635  __Pyx_GOTREF(__pyx_t_1);
13636  __pyx_r = __pyx_t_1;
13637  __pyx_t_1 = 0;
13638  goto __pyx_L0;
13639 
13640  /* "View.MemoryView":586
13641  *
13642  * @property
13643  * def itemsize(self): # <<<<<<<<<<<<<<
13644  * return self.view.itemsize
13645  *
13646  */
13647 
13648  /* function exit code */
13649  __pyx_L1_error:;
13650  __Pyx_XDECREF(__pyx_t_1);
13651  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13652  __pyx_r = NULL;
13653  __pyx_L0:;
13654  __Pyx_XGIVEREF(__pyx_r);
13655  __Pyx_RefNannyFinishContext();
13656  return __pyx_r;
13657 }
13658 
13659 /* "View.MemoryView":590
13660  *
13661  * @property
13662  * def nbytes(self): # <<<<<<<<<<<<<<
13663  * return self.size * self.view.itemsize
13664  *
13665  */
13666 
13667 /* Python wrapper */
13668 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13669 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13670  PyObject *__pyx_r = 0;
13671  __Pyx_RefNannyDeclarations
13672  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13673  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13674 
13675  /* function exit code */
13676  __Pyx_RefNannyFinishContext();
13677  return __pyx_r;
13678 }
13679 
13680 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13681  PyObject *__pyx_r = NULL;
13682  __Pyx_RefNannyDeclarations
13683  PyObject *__pyx_t_1 = NULL;
13684  PyObject *__pyx_t_2 = NULL;
13685  PyObject *__pyx_t_3 = NULL;
13686  int __pyx_lineno = 0;
13687  const char *__pyx_filename = NULL;
13688  int __pyx_clineno = 0;
13689  __Pyx_RefNannySetupContext("__get__", 0);
13690 
13691  /* "View.MemoryView":591
13692  * @property
13693  * def nbytes(self):
13694  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13695  *
13696  * @property
13697  */
13698  __Pyx_XDECREF(__pyx_r);
13699  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13700  __Pyx_GOTREF(__pyx_t_1);
13701  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13702  __Pyx_GOTREF(__pyx_t_2);
13703  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13704  __Pyx_GOTREF(__pyx_t_3);
13705  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13706  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13707  __pyx_r = __pyx_t_3;
13708  __pyx_t_3 = 0;
13709  goto __pyx_L0;
13710 
13711  /* "View.MemoryView":590
13712  *
13713  * @property
13714  * def nbytes(self): # <<<<<<<<<<<<<<
13715  * return self.size * self.view.itemsize
13716  *
13717  */
13718 
13719  /* function exit code */
13720  __pyx_L1_error:;
13721  __Pyx_XDECREF(__pyx_t_1);
13722  __Pyx_XDECREF(__pyx_t_2);
13723  __Pyx_XDECREF(__pyx_t_3);
13724  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13725  __pyx_r = NULL;
13726  __pyx_L0:;
13727  __Pyx_XGIVEREF(__pyx_r);
13728  __Pyx_RefNannyFinishContext();
13729  return __pyx_r;
13730 }
13731 
13732 /* "View.MemoryView":594
13733  *
13734  * @property
13735  * def size(self): # <<<<<<<<<<<<<<
13736  * if self._size is None:
13737  * result = 1
13738  */
13739 
13740 /* Python wrapper */
13741 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13742 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13743  PyObject *__pyx_r = 0;
13744  __Pyx_RefNannyDeclarations
13745  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13746  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13747 
13748  /* function exit code */
13749  __Pyx_RefNannyFinishContext();
13750  return __pyx_r;
13751 }
13752 
13753 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13754  PyObject *__pyx_v_result = NULL;
13755  PyObject *__pyx_v_length = NULL;
13756  PyObject *__pyx_r = NULL;
13757  __Pyx_RefNannyDeclarations
13758  int __pyx_t_1;
13759  int __pyx_t_2;
13760  Py_ssize_t *__pyx_t_3;
13761  Py_ssize_t *__pyx_t_4;
13762  Py_ssize_t *__pyx_t_5;
13763  PyObject *__pyx_t_6 = NULL;
13764  int __pyx_lineno = 0;
13765  const char *__pyx_filename = NULL;
13766  int __pyx_clineno = 0;
13767  __Pyx_RefNannySetupContext("__get__", 0);
13768 
13769  /* "View.MemoryView":595
13770  * @property
13771  * def size(self):
13772  * if self._size is None: # <<<<<<<<<<<<<<
13773  * result = 1
13774  *
13775  */
13776  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13777  __pyx_t_2 = (__pyx_t_1 != 0);
13778  if (__pyx_t_2) {
13779 
13780  /* "View.MemoryView":596
13781  * def size(self):
13782  * if self._size is None:
13783  * result = 1 # <<<<<<<<<<<<<<
13784  *
13785  * for length in self.view.shape[:self.view.ndim]:
13786  */
13787  __Pyx_INCREF(__pyx_int_1);
13788  __pyx_v_result = __pyx_int_1;
13789 
13790  /* "View.MemoryView":598
13791  * result = 1
13792  *
13793  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13794  * result *= length
13795  *
13796  */
13797  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13798  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13799  __pyx_t_3 = __pyx_t_5;
13800  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13801  __Pyx_GOTREF(__pyx_t_6);
13802  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13803  __pyx_t_6 = 0;
13804 
13805  /* "View.MemoryView":599
13806  *
13807  * for length in self.view.shape[:self.view.ndim]:
13808  * result *= length # <<<<<<<<<<<<<<
13809  *
13810  * self._size = result
13811  */
13812  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13813  __Pyx_GOTREF(__pyx_t_6);
13814  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13815  __pyx_t_6 = 0;
13816  }
13817 
13818  /* "View.MemoryView":601
13819  * result *= length
13820  *
13821  * self._size = result # <<<<<<<<<<<<<<
13822  *
13823  * return self._size
13824  */
13825  __Pyx_INCREF(__pyx_v_result);
13826  __Pyx_GIVEREF(__pyx_v_result);
13827  __Pyx_GOTREF(__pyx_v_self->_size);
13828  __Pyx_DECREF(__pyx_v_self->_size);
13829  __pyx_v_self->_size = __pyx_v_result;
13830 
13831  /* "View.MemoryView":595
13832  * @property
13833  * def size(self):
13834  * if self._size is None: # <<<<<<<<<<<<<<
13835  * result = 1
13836  *
13837  */
13838  }
13839 
13840  /* "View.MemoryView":603
13841  * self._size = result
13842  *
13843  * return self._size # <<<<<<<<<<<<<<
13844  *
13845  * def __len__(self):
13846  */
13847  __Pyx_XDECREF(__pyx_r);
13848  __Pyx_INCREF(__pyx_v_self->_size);
13849  __pyx_r = __pyx_v_self->_size;
13850  goto __pyx_L0;
13851 
13852  /* "View.MemoryView":594
13853  *
13854  * @property
13855  * def size(self): # <<<<<<<<<<<<<<
13856  * if self._size is None:
13857  * result = 1
13858  */
13859 
13860  /* function exit code */
13861  __pyx_L1_error:;
13862  __Pyx_XDECREF(__pyx_t_6);
13863  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13864  __pyx_r = NULL;
13865  __pyx_L0:;
13866  __Pyx_XDECREF(__pyx_v_result);
13867  __Pyx_XDECREF(__pyx_v_length);
13868  __Pyx_XGIVEREF(__pyx_r);
13869  __Pyx_RefNannyFinishContext();
13870  return __pyx_r;
13871 }
13872 
13873 /* "View.MemoryView":605
13874  * return self._size
13875  *
13876  * def __len__(self): # <<<<<<<<<<<<<<
13877  * if self.view.ndim >= 1:
13878  * return self.view.shape[0]
13879  */
13880 
13881 /* Python wrapper */
13882 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13883 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13884  Py_ssize_t __pyx_r;
13885  __Pyx_RefNannyDeclarations
13886  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13887  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13888 
13889  /* function exit code */
13890  __Pyx_RefNannyFinishContext();
13891  return __pyx_r;
13892 }
13893 
13894 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13895  Py_ssize_t __pyx_r;
13896  __Pyx_RefNannyDeclarations
13897  int __pyx_t_1;
13898  __Pyx_RefNannySetupContext("__len__", 0);
13899 
13900  /* "View.MemoryView":606
13901  *
13902  * def __len__(self):
13903  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13904  * return self.view.shape[0]
13905  *
13906  */
13907  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13908  if (__pyx_t_1) {
13909 
13910  /* "View.MemoryView":607
13911  * def __len__(self):
13912  * if self.view.ndim >= 1:
13913  * return self.view.shape[0] # <<<<<<<<<<<<<<
13914  *
13915  * return 0
13916  */
13917  __pyx_r = (__pyx_v_self->view.shape[0]);
13918  goto __pyx_L0;
13919 
13920  /* "View.MemoryView":606
13921  *
13922  * def __len__(self):
13923  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13924  * return self.view.shape[0]
13925  *
13926  */
13927  }
13928 
13929  /* "View.MemoryView":609
13930  * return self.view.shape[0]
13931  *
13932  * return 0 # <<<<<<<<<<<<<<
13933  *
13934  * def __repr__(self):
13935  */
13936  __pyx_r = 0;
13937  goto __pyx_L0;
13938 
13939  /* "View.MemoryView":605
13940  * return self._size
13941  *
13942  * def __len__(self): # <<<<<<<<<<<<<<
13943  * if self.view.ndim >= 1:
13944  * return self.view.shape[0]
13945  */
13946 
13947  /* function exit code */
13948  __pyx_L0:;
13949  __Pyx_RefNannyFinishContext();
13950  return __pyx_r;
13951 }
13952 
13953 /* "View.MemoryView":611
13954  * return 0
13955  *
13956  * def __repr__(self): # <<<<<<<<<<<<<<
13957  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13958  * id(self))
13959  */
13960 
13961 /* Python wrapper */
13962 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13963 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13964  PyObject *__pyx_r = 0;
13965  __Pyx_RefNannyDeclarations
13966  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13967  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13968 
13969  /* function exit code */
13970  __Pyx_RefNannyFinishContext();
13971  return __pyx_r;
13972 }
13973 
13974 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13975  PyObject *__pyx_r = NULL;
13976  __Pyx_RefNannyDeclarations
13977  PyObject *__pyx_t_1 = NULL;
13978  PyObject *__pyx_t_2 = NULL;
13979  PyObject *__pyx_t_3 = NULL;
13980  int __pyx_lineno = 0;
13981  const char *__pyx_filename = NULL;
13982  int __pyx_clineno = 0;
13983  __Pyx_RefNannySetupContext("__repr__", 0);
13984 
13985  /* "View.MemoryView":612
13986  *
13987  * def __repr__(self):
13988  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13989  * id(self))
13990  *
13991  */
13992  __Pyx_XDECREF(__pyx_r);
13993  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13994  __Pyx_GOTREF(__pyx_t_1);
13995  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13996  __Pyx_GOTREF(__pyx_t_2);
13997  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13998  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13999  __Pyx_GOTREF(__pyx_t_1);
14000  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14001 
14002  /* "View.MemoryView":613
14003  * def __repr__(self):
14004  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14005  * id(self)) # <<<<<<<<<<<<<<
14006  *
14007  * def __str__(self):
14008  */
14009  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
14010  __Pyx_GOTREF(__pyx_t_2);
14011 
14012  /* "View.MemoryView":612
14013  *
14014  * def __repr__(self):
14015  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14016  * id(self))
14017  *
14018  */
14019  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14020  __Pyx_GOTREF(__pyx_t_3);
14021  __Pyx_GIVEREF(__pyx_t_1);
14022  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14023  __Pyx_GIVEREF(__pyx_t_2);
14024  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14025  __pyx_t_1 = 0;
14026  __pyx_t_2 = 0;
14027  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14028  __Pyx_GOTREF(__pyx_t_2);
14029  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14030  __pyx_r = __pyx_t_2;
14031  __pyx_t_2 = 0;
14032  goto __pyx_L0;
14033 
14034  /* "View.MemoryView":611
14035  * return 0
14036  *
14037  * def __repr__(self): # <<<<<<<<<<<<<<
14038  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14039  * id(self))
14040  */
14041 
14042  /* function exit code */
14043  __pyx_L1_error:;
14044  __Pyx_XDECREF(__pyx_t_1);
14045  __Pyx_XDECREF(__pyx_t_2);
14046  __Pyx_XDECREF(__pyx_t_3);
14047  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14048  __pyx_r = NULL;
14049  __pyx_L0:;
14050  __Pyx_XGIVEREF(__pyx_r);
14051  __Pyx_RefNannyFinishContext();
14052  return __pyx_r;
14053 }
14054 
14055 /* "View.MemoryView":615
14056  * id(self))
14057  *
14058  * def __str__(self): # <<<<<<<<<<<<<<
14059  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14060  *
14061  */
14062 
14063 /* Python wrapper */
14064 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14065 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14066  PyObject *__pyx_r = 0;
14067  __Pyx_RefNannyDeclarations
14068  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14069  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14070 
14071  /* function exit code */
14072  __Pyx_RefNannyFinishContext();
14073  return __pyx_r;
14074 }
14075 
14076 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14077  PyObject *__pyx_r = NULL;
14078  __Pyx_RefNannyDeclarations
14079  PyObject *__pyx_t_1 = NULL;
14080  PyObject *__pyx_t_2 = NULL;
14081  int __pyx_lineno = 0;
14082  const char *__pyx_filename = NULL;
14083  int __pyx_clineno = 0;
14084  __Pyx_RefNannySetupContext("__str__", 0);
14085 
14086  /* "View.MemoryView":616
14087  *
14088  * def __str__(self):
14089  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14090  *
14091  *
14092  */
14093  __Pyx_XDECREF(__pyx_r);
14094  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14095  __Pyx_GOTREF(__pyx_t_1);
14096  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14097  __Pyx_GOTREF(__pyx_t_2);
14098  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14099  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14100  __Pyx_GOTREF(__pyx_t_1);
14101  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14102  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14103  __Pyx_GOTREF(__pyx_t_2);
14104  __Pyx_GIVEREF(__pyx_t_1);
14105  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14106  __pyx_t_1 = 0;
14107  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14108  __Pyx_GOTREF(__pyx_t_1);
14109  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14110  __pyx_r = __pyx_t_1;
14111  __pyx_t_1 = 0;
14112  goto __pyx_L0;
14113 
14114  /* "View.MemoryView":615
14115  * id(self))
14116  *
14117  * def __str__(self): # <<<<<<<<<<<<<<
14118  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14119  *
14120  */
14121 
14122  /* function exit code */
14123  __pyx_L1_error:;
14124  __Pyx_XDECREF(__pyx_t_1);
14125  __Pyx_XDECREF(__pyx_t_2);
14126  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14127  __pyx_r = NULL;
14128  __pyx_L0:;
14129  __Pyx_XGIVEREF(__pyx_r);
14130  __Pyx_RefNannyFinishContext();
14131  return __pyx_r;
14132 }
14133 
14134 /* "View.MemoryView":619
14135  *
14136  *
14137  * def is_c_contig(self): # <<<<<<<<<<<<<<
14138  * cdef __Pyx_memviewslice *mslice
14139  * cdef __Pyx_memviewslice tmp
14140  */
14141 
14142 /* Python wrapper */
14143 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14144 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14145  PyObject *__pyx_r = 0;
14146  __Pyx_RefNannyDeclarations
14147  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14148  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14149 
14150  /* function exit code */
14151  __Pyx_RefNannyFinishContext();
14152  return __pyx_r;
14153 }
14154 
14155 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14156  __Pyx_memviewslice *__pyx_v_mslice;
14157  __Pyx_memviewslice __pyx_v_tmp;
14158  PyObject *__pyx_r = NULL;
14159  __Pyx_RefNannyDeclarations
14160  __Pyx_memviewslice *__pyx_t_1;
14161  PyObject *__pyx_t_2 = NULL;
14162  int __pyx_lineno = 0;
14163  const char *__pyx_filename = NULL;
14164  int __pyx_clineno = 0;
14165  __Pyx_RefNannySetupContext("is_c_contig", 0);
14166 
14167  /* "View.MemoryView":622
14168  * cdef __Pyx_memviewslice *mslice
14169  * cdef __Pyx_memviewslice tmp
14170  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14171  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14172  *
14173  */
14174  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14175  __pyx_v_mslice = __pyx_t_1;
14176 
14177  /* "View.MemoryView":623
14178  * cdef __Pyx_memviewslice tmp
14179  * mslice = get_slice_from_memview(self, &tmp)
14180  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14181  *
14182  * def is_f_contig(self):
14183  */
14184  __Pyx_XDECREF(__pyx_r);
14185  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14186  __Pyx_GOTREF(__pyx_t_2);
14187  __pyx_r = __pyx_t_2;
14188  __pyx_t_2 = 0;
14189  goto __pyx_L0;
14190 
14191  /* "View.MemoryView":619
14192  *
14193  *
14194  * def is_c_contig(self): # <<<<<<<<<<<<<<
14195  * cdef __Pyx_memviewslice *mslice
14196  * cdef __Pyx_memviewslice tmp
14197  */
14198 
14199  /* function exit code */
14200  __pyx_L1_error:;
14201  __Pyx_XDECREF(__pyx_t_2);
14202  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14203  __pyx_r = NULL;
14204  __pyx_L0:;
14205  __Pyx_XGIVEREF(__pyx_r);
14206  __Pyx_RefNannyFinishContext();
14207  return __pyx_r;
14208 }
14209 
14210 /* "View.MemoryView":625
14211  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14212  *
14213  * def is_f_contig(self): # <<<<<<<<<<<<<<
14214  * cdef __Pyx_memviewslice *mslice
14215  * cdef __Pyx_memviewslice tmp
14216  */
14217 
14218 /* Python wrapper */
14219 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14220 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14221  PyObject *__pyx_r = 0;
14222  __Pyx_RefNannyDeclarations
14223  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14224  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14225 
14226  /* function exit code */
14227  __Pyx_RefNannyFinishContext();
14228  return __pyx_r;
14229 }
14230 
14231 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14232  __Pyx_memviewslice *__pyx_v_mslice;
14233  __Pyx_memviewslice __pyx_v_tmp;
14234  PyObject *__pyx_r = NULL;
14235  __Pyx_RefNannyDeclarations
14236  __Pyx_memviewslice *__pyx_t_1;
14237  PyObject *__pyx_t_2 = NULL;
14238  int __pyx_lineno = 0;
14239  const char *__pyx_filename = NULL;
14240  int __pyx_clineno = 0;
14241  __Pyx_RefNannySetupContext("is_f_contig", 0);
14242 
14243  /* "View.MemoryView":628
14244  * cdef __Pyx_memviewslice *mslice
14245  * cdef __Pyx_memviewslice tmp
14246  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14247  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14248  *
14249  */
14250  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14251  __pyx_v_mslice = __pyx_t_1;
14252 
14253  /* "View.MemoryView":629
14254  * cdef __Pyx_memviewslice tmp
14255  * mslice = get_slice_from_memview(self, &tmp)
14256  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14257  *
14258  * def copy(self):
14259  */
14260  __Pyx_XDECREF(__pyx_r);
14261  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14262  __Pyx_GOTREF(__pyx_t_2);
14263  __pyx_r = __pyx_t_2;
14264  __pyx_t_2 = 0;
14265  goto __pyx_L0;
14266 
14267  /* "View.MemoryView":625
14268  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14269  *
14270  * def is_f_contig(self): # <<<<<<<<<<<<<<
14271  * cdef __Pyx_memviewslice *mslice
14272  * cdef __Pyx_memviewslice tmp
14273  */
14274 
14275  /* function exit code */
14276  __pyx_L1_error:;
14277  __Pyx_XDECREF(__pyx_t_2);
14278  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14279  __pyx_r = NULL;
14280  __pyx_L0:;
14281  __Pyx_XGIVEREF(__pyx_r);
14282  __Pyx_RefNannyFinishContext();
14283  return __pyx_r;
14284 }
14285 
14286 /* "View.MemoryView":631
14287  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14288  *
14289  * def copy(self): # <<<<<<<<<<<<<<
14290  * cdef __Pyx_memviewslice mslice
14291  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14292  */
14293 
14294 /* Python wrapper */
14295 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14296 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14297  PyObject *__pyx_r = 0;
14298  __Pyx_RefNannyDeclarations
14299  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14300  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14301 
14302  /* function exit code */
14303  __Pyx_RefNannyFinishContext();
14304  return __pyx_r;
14305 }
14306 
14307 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14308  __Pyx_memviewslice __pyx_v_mslice;
14309  int __pyx_v_flags;
14310  PyObject *__pyx_r = NULL;
14311  __Pyx_RefNannyDeclarations
14312  __Pyx_memviewslice __pyx_t_1;
14313  PyObject *__pyx_t_2 = NULL;
14314  int __pyx_lineno = 0;
14315  const char *__pyx_filename = NULL;
14316  int __pyx_clineno = 0;
14317  __Pyx_RefNannySetupContext("copy", 0);
14318 
14319  /* "View.MemoryView":633
14320  * def copy(self):
14321  * cdef __Pyx_memviewslice mslice
14322  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14323  *
14324  * slice_copy(self, &mslice)
14325  */
14326  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14327 
14328  /* "View.MemoryView":635
14329  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14330  *
14331  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14332  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14333  * self.view.itemsize,
14334  */
14335  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14336 
14337  /* "View.MemoryView":636
14338  *
14339  * slice_copy(self, &mslice)
14340  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14341  * self.view.itemsize,
14342  * flags|PyBUF_C_CONTIGUOUS,
14343  */
14344  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14345  __pyx_v_mslice = __pyx_t_1;
14346 
14347  /* "View.MemoryView":641
14348  * self.dtype_is_object)
14349  *
14350  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14351  *
14352  * def copy_fortran(self):
14353  */
14354  __Pyx_XDECREF(__pyx_r);
14355  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14356  __Pyx_GOTREF(__pyx_t_2);
14357  __pyx_r = __pyx_t_2;
14358  __pyx_t_2 = 0;
14359  goto __pyx_L0;
14360 
14361  /* "View.MemoryView":631
14362  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14363  *
14364  * def copy(self): # <<<<<<<<<<<<<<
14365  * cdef __Pyx_memviewslice mslice
14366  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14367  */
14368 
14369  /* function exit code */
14370  __pyx_L1_error:;
14371  __Pyx_XDECREF(__pyx_t_2);
14372  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14373  __pyx_r = NULL;
14374  __pyx_L0:;
14375  __Pyx_XGIVEREF(__pyx_r);
14376  __Pyx_RefNannyFinishContext();
14377  return __pyx_r;
14378 }
14379 
14380 /* "View.MemoryView":643
14381  * return memoryview_copy_from_slice(self, &mslice)
14382  *
14383  * def copy_fortran(self): # <<<<<<<<<<<<<<
14384  * cdef __Pyx_memviewslice src, dst
14385  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14386  */
14387 
14388 /* Python wrapper */
14389 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14390 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14391  PyObject *__pyx_r = 0;
14392  __Pyx_RefNannyDeclarations
14393  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14394  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14395 
14396  /* function exit code */
14397  __Pyx_RefNannyFinishContext();
14398  return __pyx_r;
14399 }
14400 
14401 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14402  __Pyx_memviewslice __pyx_v_src;
14403  __Pyx_memviewslice __pyx_v_dst;
14404  int __pyx_v_flags;
14405  PyObject *__pyx_r = NULL;
14406  __Pyx_RefNannyDeclarations
14407  __Pyx_memviewslice __pyx_t_1;
14408  PyObject *__pyx_t_2 = NULL;
14409  int __pyx_lineno = 0;
14410  const char *__pyx_filename = NULL;
14411  int __pyx_clineno = 0;
14412  __Pyx_RefNannySetupContext("copy_fortran", 0);
14413 
14414  /* "View.MemoryView":645
14415  * def copy_fortran(self):
14416  * cdef __Pyx_memviewslice src, dst
14417  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14418  *
14419  * slice_copy(self, &src)
14420  */
14421  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14422 
14423  /* "View.MemoryView":647
14424  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14425  *
14426  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14427  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14428  * self.view.itemsize,
14429  */
14430  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14431 
14432  /* "View.MemoryView":648
14433  *
14434  * slice_copy(self, &src)
14435  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14436  * self.view.itemsize,
14437  * flags|PyBUF_F_CONTIGUOUS,
14438  */
14439  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14440  __pyx_v_dst = __pyx_t_1;
14441 
14442  /* "View.MemoryView":653
14443  * self.dtype_is_object)
14444  *
14445  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14446  *
14447  *
14448  */
14449  __Pyx_XDECREF(__pyx_r);
14450  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14451  __Pyx_GOTREF(__pyx_t_2);
14452  __pyx_r = __pyx_t_2;
14453  __pyx_t_2 = 0;
14454  goto __pyx_L0;
14455 
14456  /* "View.MemoryView":643
14457  * return memoryview_copy_from_slice(self, &mslice)
14458  *
14459  * def copy_fortran(self): # <<<<<<<<<<<<<<
14460  * cdef __Pyx_memviewslice src, dst
14461  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14462  */
14463 
14464  /* function exit code */
14465  __pyx_L1_error:;
14466  __Pyx_XDECREF(__pyx_t_2);
14467  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14468  __pyx_r = NULL;
14469  __pyx_L0:;
14470  __Pyx_XGIVEREF(__pyx_r);
14471  __Pyx_RefNannyFinishContext();
14472  return __pyx_r;
14473 }
14474 
14475 /* "(tree fragment)":1
14476  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14477  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14478  * def __setstate_cython__(self, __pyx_state):
14479  */
14480 
14481 /* Python wrapper */
14482 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14483 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14484  PyObject *__pyx_r = 0;
14485  __Pyx_RefNannyDeclarations
14486  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14487  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14488 
14489  /* function exit code */
14490  __Pyx_RefNannyFinishContext();
14491  return __pyx_r;
14492 }
14493 
14494 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14495  PyObject *__pyx_r = NULL;
14496  __Pyx_RefNannyDeclarations
14497  PyObject *__pyx_t_1 = NULL;
14498  int __pyx_lineno = 0;
14499  const char *__pyx_filename = NULL;
14500  int __pyx_clineno = 0;
14501  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14502 
14503  /* "(tree fragment)":2
14504  * def __reduce_cython__(self):
14505  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14506  * def __setstate_cython__(self, __pyx_state):
14507  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14508  */
14509  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14510  __Pyx_GOTREF(__pyx_t_1);
14511  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14512  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14513  __PYX_ERR(1, 2, __pyx_L1_error)
14514 
14515  /* "(tree fragment)":1
14516  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14517  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14518  * def __setstate_cython__(self, __pyx_state):
14519  */
14520 
14521  /* function exit code */
14522  __pyx_L1_error:;
14523  __Pyx_XDECREF(__pyx_t_1);
14524  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14525  __pyx_r = NULL;
14526  __Pyx_XGIVEREF(__pyx_r);
14527  __Pyx_RefNannyFinishContext();
14528  return __pyx_r;
14529 }
14530 
14531 /* "(tree fragment)":3
14532  * def __reduce_cython__(self):
14533  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14534  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14535  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14536  */
14537 
14538 /* Python wrapper */
14539 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14540 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14541  PyObject *__pyx_r = 0;
14542  __Pyx_RefNannyDeclarations
14543  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14544  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14545 
14546  /* function exit code */
14547  __Pyx_RefNannyFinishContext();
14548  return __pyx_r;
14549 }
14550 
14551 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14552  PyObject *__pyx_r = NULL;
14553  __Pyx_RefNannyDeclarations
14554  PyObject *__pyx_t_1 = NULL;
14555  int __pyx_lineno = 0;
14556  const char *__pyx_filename = NULL;
14557  int __pyx_clineno = 0;
14558  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14559 
14560  /* "(tree fragment)":4
14561  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14562  * def __setstate_cython__(self, __pyx_state):
14563  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14564  */
14565  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14566  __Pyx_GOTREF(__pyx_t_1);
14567  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14568  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14569  __PYX_ERR(1, 4, __pyx_L1_error)
14570 
14571  /* "(tree fragment)":3
14572  * def __reduce_cython__(self):
14573  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14574  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14575  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14576  */
14577 
14578  /* function exit code */
14579  __pyx_L1_error:;
14580  __Pyx_XDECREF(__pyx_t_1);
14581  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14582  __pyx_r = NULL;
14583  __Pyx_XGIVEREF(__pyx_r);
14584  __Pyx_RefNannyFinishContext();
14585  return __pyx_r;
14586 }
14587 
14588 /* "View.MemoryView":657
14589  *
14590  * @cname('__pyx_memoryview_new')
14591  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14592  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14593  * result.typeinfo = typeinfo
14594  */
14595 
14596 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14597  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14598  PyObject *__pyx_r = NULL;
14599  __Pyx_RefNannyDeclarations
14600  PyObject *__pyx_t_1 = NULL;
14601  PyObject *__pyx_t_2 = NULL;
14602  PyObject *__pyx_t_3 = NULL;
14603  int __pyx_lineno = 0;
14604  const char *__pyx_filename = NULL;
14605  int __pyx_clineno = 0;
14606  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14607 
14608  /* "View.MemoryView":658
14609  * @cname('__pyx_memoryview_new')
14610  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14611  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14612  * result.typeinfo = typeinfo
14613  * return result
14614  */
14615  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14616  __Pyx_GOTREF(__pyx_t_1);
14617  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14618  __Pyx_GOTREF(__pyx_t_2);
14619  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14620  __Pyx_GOTREF(__pyx_t_3);
14621  __Pyx_INCREF(__pyx_v_o);
14622  __Pyx_GIVEREF(__pyx_v_o);
14623  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14624  __Pyx_GIVEREF(__pyx_t_1);
14625  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14626  __Pyx_GIVEREF(__pyx_t_2);
14627  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14628  __pyx_t_1 = 0;
14629  __pyx_t_2 = 0;
14630  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14631  __Pyx_GOTREF(__pyx_t_2);
14632  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14633  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14634  __pyx_t_2 = 0;
14635 
14636  /* "View.MemoryView":659
14637  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14638  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14639  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14640  * return result
14641  *
14642  */
14643  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14644 
14645  /* "View.MemoryView":660
14646  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14647  * result.typeinfo = typeinfo
14648  * return result # <<<<<<<<<<<<<<
14649  *
14650  * @cname('__pyx_memoryview_check')
14651  */
14652  __Pyx_XDECREF(__pyx_r);
14653  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14654  __pyx_r = ((PyObject *)__pyx_v_result);
14655  goto __pyx_L0;
14656 
14657  /* "View.MemoryView":657
14658  *
14659  * @cname('__pyx_memoryview_new')
14660  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14661  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14662  * result.typeinfo = typeinfo
14663  */
14664 
14665  /* function exit code */
14666  __pyx_L1_error:;
14667  __Pyx_XDECREF(__pyx_t_1);
14668  __Pyx_XDECREF(__pyx_t_2);
14669  __Pyx_XDECREF(__pyx_t_3);
14670  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14671  __pyx_r = 0;
14672  __pyx_L0:;
14673  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14674  __Pyx_XGIVEREF(__pyx_r);
14675  __Pyx_RefNannyFinishContext();
14676  return __pyx_r;
14677 }
14678 
14679 /* "View.MemoryView":663
14680  *
14681  * @cname('__pyx_memoryview_check')
14682  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14683  * return isinstance(o, memoryview)
14684  *
14685  */
14686 
14687 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14688  int __pyx_r;
14689  __Pyx_RefNannyDeclarations
14690  int __pyx_t_1;
14691  __Pyx_RefNannySetupContext("memoryview_check", 0);
14692 
14693  /* "View.MemoryView":664
14694  * @cname('__pyx_memoryview_check')
14695  * cdef inline bint memoryview_check(object o):
14696  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14697  *
14698  * cdef tuple _unellipsify(object index, int ndim):
14699  */
14700  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14701  __pyx_r = __pyx_t_1;
14702  goto __pyx_L0;
14703 
14704  /* "View.MemoryView":663
14705  *
14706  * @cname('__pyx_memoryview_check')
14707  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14708  * return isinstance(o, memoryview)
14709  *
14710  */
14711 
14712  /* function exit code */
14713  __pyx_L0:;
14714  __Pyx_RefNannyFinishContext();
14715  return __pyx_r;
14716 }
14717 
14718 /* "View.MemoryView":666
14719  * return isinstance(o, memoryview)
14720  *
14721  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14722  * """
14723  * Replace all ellipses with full slices and fill incomplete indices with
14724  */
14725 
14726 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14727  PyObject *__pyx_v_tup = NULL;
14728  PyObject *__pyx_v_result = NULL;
14729  int __pyx_v_have_slices;
14730  int __pyx_v_seen_ellipsis;
14731  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14732  PyObject *__pyx_v_item = NULL;
14733  Py_ssize_t __pyx_v_nslices;
14734  PyObject *__pyx_r = NULL;
14735  __Pyx_RefNannyDeclarations
14736  int __pyx_t_1;
14737  int __pyx_t_2;
14738  PyObject *__pyx_t_3 = NULL;
14739  PyObject *__pyx_t_4 = NULL;
14740  Py_ssize_t __pyx_t_5;
14741  PyObject *(*__pyx_t_6)(PyObject *);
14742  PyObject *__pyx_t_7 = NULL;
14743  Py_ssize_t __pyx_t_8;
14744  int __pyx_t_9;
14745  int __pyx_t_10;
14746  PyObject *__pyx_t_11 = NULL;
14747  int __pyx_lineno = 0;
14748  const char *__pyx_filename = NULL;
14749  int __pyx_clineno = 0;
14750  __Pyx_RefNannySetupContext("_unellipsify", 0);
14751 
14752  /* "View.MemoryView":671
14753  * full slices.
14754  * """
14755  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14756  * tup = (index,)
14757  * else:
14758  */
14759  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14760  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14761  if (__pyx_t_2) {
14762 
14763  /* "View.MemoryView":672
14764  * """
14765  * if not isinstance(index, tuple):
14766  * tup = (index,) # <<<<<<<<<<<<<<
14767  * else:
14768  * tup = index
14769  */
14770  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14771  __Pyx_GOTREF(__pyx_t_3);
14772  __Pyx_INCREF(__pyx_v_index);
14773  __Pyx_GIVEREF(__pyx_v_index);
14774  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14775  __pyx_v_tup = __pyx_t_3;
14776  __pyx_t_3 = 0;
14777 
14778  /* "View.MemoryView":671
14779  * full slices.
14780  * """
14781  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14782  * tup = (index,)
14783  * else:
14784  */
14785  goto __pyx_L3;
14786  }
14787 
14788  /* "View.MemoryView":674
14789  * tup = (index,)
14790  * else:
14791  * tup = index # <<<<<<<<<<<<<<
14792  *
14793  * result = []
14794  */
14795  /*else*/ {
14796  __Pyx_INCREF(__pyx_v_index);
14797  __pyx_v_tup = __pyx_v_index;
14798  }
14799  __pyx_L3:;
14800 
14801  /* "View.MemoryView":676
14802  * tup = index
14803  *
14804  * result = [] # <<<<<<<<<<<<<<
14805  * have_slices = False
14806  * seen_ellipsis = False
14807  */
14808  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14809  __Pyx_GOTREF(__pyx_t_3);
14810  __pyx_v_result = ((PyObject*)__pyx_t_3);
14811  __pyx_t_3 = 0;
14812 
14813  /* "View.MemoryView":677
14814  *
14815  * result = []
14816  * have_slices = False # <<<<<<<<<<<<<<
14817  * seen_ellipsis = False
14818  * for idx, item in enumerate(tup):
14819  */
14820  __pyx_v_have_slices = 0;
14821 
14822  /* "View.MemoryView":678
14823  * result = []
14824  * have_slices = False
14825  * seen_ellipsis = False # <<<<<<<<<<<<<<
14826  * for idx, item in enumerate(tup):
14827  * if item is Ellipsis:
14828  */
14829  __pyx_v_seen_ellipsis = 0;
14830 
14831  /* "View.MemoryView":679
14832  * have_slices = False
14833  * seen_ellipsis = False
14834  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14835  * if item is Ellipsis:
14836  * if not seen_ellipsis:
14837  */
14838  __Pyx_INCREF(__pyx_int_0);
14839  __pyx_t_3 = __pyx_int_0;
14840  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14841  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14842  __pyx_t_6 = NULL;
14843  } else {
14844  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14845  __Pyx_GOTREF(__pyx_t_4);
14846  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14847  }
14848  for (;;) {
14849  if (likely(!__pyx_t_6)) {
14850  if (likely(PyList_CheckExact(__pyx_t_4))) {
14851  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14852  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14853  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14854  #else
14855  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14856  __Pyx_GOTREF(__pyx_t_7);
14857  #endif
14858  } else {
14859  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14860  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14861  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14862  #else
14863  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14864  __Pyx_GOTREF(__pyx_t_7);
14865  #endif
14866  }
14867  } else {
14868  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14869  if (unlikely(!__pyx_t_7)) {
14870  PyObject* exc_type = PyErr_Occurred();
14871  if (exc_type) {
14872  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14873  else __PYX_ERR(1, 679, __pyx_L1_error)
14874  }
14875  break;
14876  }
14877  __Pyx_GOTREF(__pyx_t_7);
14878  }
14879  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14880  __pyx_t_7 = 0;
14881  __Pyx_INCREF(__pyx_t_3);
14882  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14883  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14884  __Pyx_GOTREF(__pyx_t_7);
14885  __Pyx_DECREF(__pyx_t_3);
14886  __pyx_t_3 = __pyx_t_7;
14887  __pyx_t_7 = 0;
14888 
14889  /* "View.MemoryView":680
14890  * seen_ellipsis = False
14891  * for idx, item in enumerate(tup):
14892  * if item is Ellipsis: # <<<<<<<<<<<<<<
14893  * if not seen_ellipsis:
14894  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14895  */
14896  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14897  __pyx_t_1 = (__pyx_t_2 != 0);
14898  if (__pyx_t_1) {
14899 
14900  /* "View.MemoryView":681
14901  * for idx, item in enumerate(tup):
14902  * if item is Ellipsis:
14903  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14904  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14905  * seen_ellipsis = True
14906  */
14907  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14908  if (__pyx_t_1) {
14909 
14910  /* "View.MemoryView":682
14911  * if item is Ellipsis:
14912  * if not seen_ellipsis:
14913  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14914  * seen_ellipsis = True
14915  * else:
14916  */
14917  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14918  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14919  __Pyx_GOTREF(__pyx_t_7);
14920  { Py_ssize_t __pyx_temp;
14921  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14922  __Pyx_INCREF(__pyx_slice__21);
14923  __Pyx_GIVEREF(__pyx_slice__21);
14924  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__21);
14925  }
14926  }
14927  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14928  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14929 
14930  /* "View.MemoryView":683
14931  * if not seen_ellipsis:
14932  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14933  * seen_ellipsis = True # <<<<<<<<<<<<<<
14934  * else:
14935  * result.append(slice(None))
14936  */
14937  __pyx_v_seen_ellipsis = 1;
14938 
14939  /* "View.MemoryView":681
14940  * for idx, item in enumerate(tup):
14941  * if item is Ellipsis:
14942  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14943  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14944  * seen_ellipsis = True
14945  */
14946  goto __pyx_L7;
14947  }
14948 
14949  /* "View.MemoryView":685
14950  * seen_ellipsis = True
14951  * else:
14952  * result.append(slice(None)) # <<<<<<<<<<<<<<
14953  * have_slices = True
14954  * else:
14955  */
14956  /*else*/ {
14957  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14958  }
14959  __pyx_L7:;
14960 
14961  /* "View.MemoryView":686
14962  * else:
14963  * result.append(slice(None))
14964  * have_slices = True # <<<<<<<<<<<<<<
14965  * else:
14966  * if not isinstance(item, slice) and not PyIndex_Check(item):
14967  */
14968  __pyx_v_have_slices = 1;
14969 
14970  /* "View.MemoryView":680
14971  * seen_ellipsis = False
14972  * for idx, item in enumerate(tup):
14973  * if item is Ellipsis: # <<<<<<<<<<<<<<
14974  * if not seen_ellipsis:
14975  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14976  */
14977  goto __pyx_L6;
14978  }
14979 
14980  /* "View.MemoryView":688
14981  * have_slices = True
14982  * else:
14983  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14984  * raise TypeError("Cannot index with type '%s'" % type(item))
14985  *
14986  */
14987  /*else*/ {
14988  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14989  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14990  if (__pyx_t_10) {
14991  } else {
14992  __pyx_t_1 = __pyx_t_10;
14993  goto __pyx_L9_bool_binop_done;
14994  }
14995  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14996  __pyx_t_1 = __pyx_t_10;
14997  __pyx_L9_bool_binop_done:;
14998  if (unlikely(__pyx_t_1)) {
14999 
15000  /* "View.MemoryView":689
15001  * else:
15002  * if not isinstance(item, slice) and not PyIndex_Check(item):
15003  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15004  *
15005  * have_slices = have_slices or isinstance(item, slice)
15006  */
15007  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
15008  __Pyx_GOTREF(__pyx_t_7);
15009  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15010  __Pyx_GOTREF(__pyx_t_11);
15011  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15012  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15013  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15014  __PYX_ERR(1, 689, __pyx_L1_error)
15015 
15016  /* "View.MemoryView":688
15017  * have_slices = True
15018  * else:
15019  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15020  * raise TypeError("Cannot index with type '%s'" % type(item))
15021  *
15022  */
15023  }
15024 
15025  /* "View.MemoryView":691
15026  * raise TypeError("Cannot index with type '%s'" % type(item))
15027  *
15028  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15029  * result.append(item)
15030  *
15031  */
15032  __pyx_t_10 = (__pyx_v_have_slices != 0);
15033  if (!__pyx_t_10) {
15034  } else {
15035  __pyx_t_1 = __pyx_t_10;
15036  goto __pyx_L11_bool_binop_done;
15037  }
15038  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15039  __pyx_t_2 = (__pyx_t_10 != 0);
15040  __pyx_t_1 = __pyx_t_2;
15041  __pyx_L11_bool_binop_done:;
15042  __pyx_v_have_slices = __pyx_t_1;
15043 
15044  /* "View.MemoryView":692
15045  *
15046  * have_slices = have_slices or isinstance(item, slice)
15047  * result.append(item) # <<<<<<<<<<<<<<
15048  *
15049  * nslices = ndim - len(result)
15050  */
15051  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15052  }
15053  __pyx_L6:;
15054 
15055  /* "View.MemoryView":679
15056  * have_slices = False
15057  * seen_ellipsis = False
15058  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15059  * if item is Ellipsis:
15060  * if not seen_ellipsis:
15061  */
15062  }
15063  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15064  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15065 
15066  /* "View.MemoryView":694
15067  * result.append(item)
15068  *
15069  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15070  * if nslices:
15071  * result.extend([slice(None)] * nslices)
15072  */
15073  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15074  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15075 
15076  /* "View.MemoryView":695
15077  *
15078  * nslices = ndim - len(result)
15079  * if nslices: # <<<<<<<<<<<<<<
15080  * result.extend([slice(None)] * nslices)
15081  *
15082  */
15083  __pyx_t_1 = (__pyx_v_nslices != 0);
15084  if (__pyx_t_1) {
15085 
15086  /* "View.MemoryView":696
15087  * nslices = ndim - len(result)
15088  * if nslices:
15089  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15090  *
15091  * return have_slices or nslices, tuple(result)
15092  */
15093  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15094  __Pyx_GOTREF(__pyx_t_3);
15095  { Py_ssize_t __pyx_temp;
15096  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15097  __Pyx_INCREF(__pyx_slice__21);
15098  __Pyx_GIVEREF(__pyx_slice__21);
15099  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21);
15100  }
15101  }
15102  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15103  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15104 
15105  /* "View.MemoryView":695
15106  *
15107  * nslices = ndim - len(result)
15108  * if nslices: # <<<<<<<<<<<<<<
15109  * result.extend([slice(None)] * nslices)
15110  *
15111  */
15112  }
15113 
15114  /* "View.MemoryView":698
15115  * result.extend([slice(None)] * nslices)
15116  *
15117  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15118  *
15119  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15120  */
15121  __Pyx_XDECREF(__pyx_r);
15122  if (!__pyx_v_have_slices) {
15123  } else {
15124  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15125  __Pyx_GOTREF(__pyx_t_4);
15126  __pyx_t_3 = __pyx_t_4;
15127  __pyx_t_4 = 0;
15128  goto __pyx_L14_bool_binop_done;
15129  }
15130  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15131  __Pyx_GOTREF(__pyx_t_4);
15132  __pyx_t_3 = __pyx_t_4;
15133  __pyx_t_4 = 0;
15134  __pyx_L14_bool_binop_done:;
15135  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15136  __Pyx_GOTREF(__pyx_t_4);
15137  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15138  __Pyx_GOTREF(__pyx_t_11);
15139  __Pyx_GIVEREF(__pyx_t_3);
15140  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15141  __Pyx_GIVEREF(__pyx_t_4);
15142  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15143  __pyx_t_3 = 0;
15144  __pyx_t_4 = 0;
15145  __pyx_r = ((PyObject*)__pyx_t_11);
15146  __pyx_t_11 = 0;
15147  goto __pyx_L0;
15148 
15149  /* "View.MemoryView":666
15150  * return isinstance(o, memoryview)
15151  *
15152  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15153  * """
15154  * Replace all ellipses with full slices and fill incomplete indices with
15155  */
15156 
15157  /* function exit code */
15158  __pyx_L1_error:;
15159  __Pyx_XDECREF(__pyx_t_3);
15160  __Pyx_XDECREF(__pyx_t_4);
15161  __Pyx_XDECREF(__pyx_t_7);
15162  __Pyx_XDECREF(__pyx_t_11);
15163  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15164  __pyx_r = 0;
15165  __pyx_L0:;
15166  __Pyx_XDECREF(__pyx_v_tup);
15167  __Pyx_XDECREF(__pyx_v_result);
15168  __Pyx_XDECREF(__pyx_v_idx);
15169  __Pyx_XDECREF(__pyx_v_item);
15170  __Pyx_XGIVEREF(__pyx_r);
15171  __Pyx_RefNannyFinishContext();
15172  return __pyx_r;
15173 }
15174 
15175 /* "View.MemoryView":700
15176  * return have_slices or nslices, tuple(result)
15177  *
15178  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15179  * for suboffset in suboffsets[:ndim]:
15180  * if suboffset >= 0:
15181  */
15182 
15183 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15184  Py_ssize_t __pyx_v_suboffset;
15185  PyObject *__pyx_r = NULL;
15186  __Pyx_RefNannyDeclarations
15187  Py_ssize_t *__pyx_t_1;
15188  Py_ssize_t *__pyx_t_2;
15189  Py_ssize_t *__pyx_t_3;
15190  int __pyx_t_4;
15191  PyObject *__pyx_t_5 = NULL;
15192  int __pyx_lineno = 0;
15193  const char *__pyx_filename = NULL;
15194  int __pyx_clineno = 0;
15195  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15196 
15197  /* "View.MemoryView":701
15198  *
15199  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15200  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15201  * if suboffset >= 0:
15202  * raise ValueError("Indirect dimensions not supported")
15203  */
15204  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15205  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15206  __pyx_t_1 = __pyx_t_3;
15207  __pyx_v_suboffset = (__pyx_t_1[0]);
15208 
15209  /* "View.MemoryView":702
15210  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15211  * for suboffset in suboffsets[:ndim]:
15212  * if suboffset >= 0: # <<<<<<<<<<<<<<
15213  * raise ValueError("Indirect dimensions not supported")
15214  *
15215  */
15216  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15217  if (unlikely(__pyx_t_4)) {
15218 
15219  /* "View.MemoryView":703
15220  * for suboffset in suboffsets[:ndim]:
15221  * if suboffset >= 0:
15222  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15223  *
15224  *
15225  */
15226  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15227  __Pyx_GOTREF(__pyx_t_5);
15228  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15229  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15230  __PYX_ERR(1, 703, __pyx_L1_error)
15231 
15232  /* "View.MemoryView":702
15233  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15234  * for suboffset in suboffsets[:ndim]:
15235  * if suboffset >= 0: # <<<<<<<<<<<<<<
15236  * raise ValueError("Indirect dimensions not supported")
15237  *
15238  */
15239  }
15240  }
15241 
15242  /* "View.MemoryView":700
15243  * return have_slices or nslices, tuple(result)
15244  *
15245  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15246  * for suboffset in suboffsets[:ndim]:
15247  * if suboffset >= 0:
15248  */
15249 
15250  /* function exit code */
15251  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15252  goto __pyx_L0;
15253  __pyx_L1_error:;
15254  __Pyx_XDECREF(__pyx_t_5);
15255  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15256  __pyx_r = 0;
15257  __pyx_L0:;
15258  __Pyx_XGIVEREF(__pyx_r);
15259  __Pyx_RefNannyFinishContext();
15260  return __pyx_r;
15261 }
15262 
15263 /* "View.MemoryView":710
15264  *
15265  * @cname('__pyx_memview_slice')
15266  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15267  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15268  * cdef bint negative_step
15269  */
15270 
15271 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15272  int __pyx_v_new_ndim;
15273  int __pyx_v_suboffset_dim;
15274  int __pyx_v_dim;
15275  __Pyx_memviewslice __pyx_v_src;
15276  __Pyx_memviewslice __pyx_v_dst;
15277  __Pyx_memviewslice *__pyx_v_p_src;
15278  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15279  __Pyx_memviewslice *__pyx_v_p_dst;
15280  int *__pyx_v_p_suboffset_dim;
15281  Py_ssize_t __pyx_v_start;
15282  Py_ssize_t __pyx_v_stop;
15283  Py_ssize_t __pyx_v_step;
15284  int __pyx_v_have_start;
15285  int __pyx_v_have_stop;
15286  int __pyx_v_have_step;
15287  PyObject *__pyx_v_index = NULL;
15288  struct __pyx_memoryview_obj *__pyx_r = NULL;
15289  __Pyx_RefNannyDeclarations
15290  int __pyx_t_1;
15291  int __pyx_t_2;
15292  PyObject *__pyx_t_3 = NULL;
15293  struct __pyx_memoryview_obj *__pyx_t_4;
15294  char *__pyx_t_5;
15295  int __pyx_t_6;
15296  Py_ssize_t __pyx_t_7;
15297  PyObject *(*__pyx_t_8)(PyObject *);
15298  PyObject *__pyx_t_9 = NULL;
15299  Py_ssize_t __pyx_t_10;
15300  int __pyx_t_11;
15301  Py_ssize_t __pyx_t_12;
15302  int __pyx_lineno = 0;
15303  const char *__pyx_filename = NULL;
15304  int __pyx_clineno = 0;
15305  __Pyx_RefNannySetupContext("memview_slice", 0);
15306 
15307  /* "View.MemoryView":711
15308  * @cname('__pyx_memview_slice')
15309  * cdef memoryview memview_slice(memoryview memview, object indices):
15310  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15311  * cdef bint negative_step
15312  * cdef __Pyx_memviewslice src, dst
15313  */
15314  __pyx_v_new_ndim = 0;
15315  __pyx_v_suboffset_dim = -1;
15316 
15317  /* "View.MemoryView":718
15318  *
15319  *
15320  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15321  *
15322  * cdef _memoryviewslice memviewsliceobj
15323  */
15324  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15325 
15326  /* "View.MemoryView":722
15327  * cdef _memoryviewslice memviewsliceobj
15328  *
15329  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15330  *
15331  * if isinstance(memview, _memoryviewslice):
15332  */
15333  #ifndef CYTHON_WITHOUT_ASSERTIONS
15334  if (unlikely(!Py_OptimizeFlag)) {
15335  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15336  PyErr_SetNone(PyExc_AssertionError);
15337  __PYX_ERR(1, 722, __pyx_L1_error)
15338  }
15339  }
15340  #endif
15341 
15342  /* "View.MemoryView":724
15343  * assert memview.view.ndim > 0
15344  *
15345  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15346  * memviewsliceobj = memview
15347  * p_src = &memviewsliceobj.from_slice
15348  */
15349  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15350  __pyx_t_2 = (__pyx_t_1 != 0);
15351  if (__pyx_t_2) {
15352 
15353  /* "View.MemoryView":725
15354  *
15355  * if isinstance(memview, _memoryviewslice):
15356  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15357  * p_src = &memviewsliceobj.from_slice
15358  * else:
15359  */
15360  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15361  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15362  __Pyx_INCREF(__pyx_t_3);
15363  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15364  __pyx_t_3 = 0;
15365 
15366  /* "View.MemoryView":726
15367  * if isinstance(memview, _memoryviewslice):
15368  * memviewsliceobj = memview
15369  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15370  * else:
15371  * slice_copy(memview, &src)
15372  */
15373  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15374 
15375  /* "View.MemoryView":724
15376  * assert memview.view.ndim > 0
15377  *
15378  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15379  * memviewsliceobj = memview
15380  * p_src = &memviewsliceobj.from_slice
15381  */
15382  goto __pyx_L3;
15383  }
15384 
15385  /* "View.MemoryView":728
15386  * p_src = &memviewsliceobj.from_slice
15387  * else:
15388  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15389  * p_src = &src
15390  *
15391  */
15392  /*else*/ {
15393  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15394 
15395  /* "View.MemoryView":729
15396  * else:
15397  * slice_copy(memview, &src)
15398  * p_src = &src # <<<<<<<<<<<<<<
15399  *
15400  *
15401  */
15402  __pyx_v_p_src = (&__pyx_v_src);
15403  }
15404  __pyx_L3:;
15405 
15406  /* "View.MemoryView":735
15407  *
15408  *
15409  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15410  * dst.data = p_src.data
15411  *
15412  */
15413  __pyx_t_4 = __pyx_v_p_src->memview;
15414  __pyx_v_dst.memview = __pyx_t_4;
15415 
15416  /* "View.MemoryView":736
15417  *
15418  * dst.memview = p_src.memview
15419  * dst.data = p_src.data # <<<<<<<<<<<<<<
15420  *
15421  *
15422  */
15423  __pyx_t_5 = __pyx_v_p_src->data;
15424  __pyx_v_dst.data = __pyx_t_5;
15425 
15426  /* "View.MemoryView":741
15427  *
15428  *
15429  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15430  * cdef int *p_suboffset_dim = &suboffset_dim
15431  * cdef Py_ssize_t start, stop, step
15432  */
15433  __pyx_v_p_dst = (&__pyx_v_dst);
15434 
15435  /* "View.MemoryView":742
15436  *
15437  * cdef __Pyx_memviewslice *p_dst = &dst
15438  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15439  * cdef Py_ssize_t start, stop, step
15440  * cdef bint have_start, have_stop, have_step
15441  */
15442  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15443 
15444  /* "View.MemoryView":746
15445  * cdef bint have_start, have_stop, have_step
15446  *
15447  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15448  * if PyIndex_Check(index):
15449  * slice_memviewslice(
15450  */
15451  __pyx_t_6 = 0;
15452  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15453  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15454  __pyx_t_8 = NULL;
15455  } else {
15456  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15457  __Pyx_GOTREF(__pyx_t_3);
15458  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15459  }
15460  for (;;) {
15461  if (likely(!__pyx_t_8)) {
15462  if (likely(PyList_CheckExact(__pyx_t_3))) {
15463  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15464  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15465  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15466  #else
15467  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15468  __Pyx_GOTREF(__pyx_t_9);
15469  #endif
15470  } else {
15471  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15472  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15473  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15474  #else
15475  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15476  __Pyx_GOTREF(__pyx_t_9);
15477  #endif
15478  }
15479  } else {
15480  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15481  if (unlikely(!__pyx_t_9)) {
15482  PyObject* exc_type = PyErr_Occurred();
15483  if (exc_type) {
15484  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15485  else __PYX_ERR(1, 746, __pyx_L1_error)
15486  }
15487  break;
15488  }
15489  __Pyx_GOTREF(__pyx_t_9);
15490  }
15491  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15492  __pyx_t_9 = 0;
15493  __pyx_v_dim = __pyx_t_6;
15494  __pyx_t_6 = (__pyx_t_6 + 1);
15495 
15496  /* "View.MemoryView":747
15497  *
15498  * for dim, index in enumerate(indices):
15499  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15500  * slice_memviewslice(
15501  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15502  */
15503  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15504  if (__pyx_t_2) {
15505 
15506  /* "View.MemoryView":751
15507  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15508  * dim, new_ndim, p_suboffset_dim,
15509  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15510  * 0, 0, 0, # have_{start,stop,step}
15511  * False)
15512  */
15513  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15514 
15515  /* "View.MemoryView":748
15516  * for dim, index in enumerate(indices):
15517  * if PyIndex_Check(index):
15518  * slice_memviewslice( # <<<<<<<<<<<<<<
15519  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15520  * dim, new_ndim, p_suboffset_dim,
15521  */
15522  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15523 
15524  /* "View.MemoryView":747
15525  *
15526  * for dim, index in enumerate(indices):
15527  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15528  * slice_memviewslice(
15529  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15530  */
15531  goto __pyx_L6;
15532  }
15533 
15534  /* "View.MemoryView":754
15535  * 0, 0, 0, # have_{start,stop,step}
15536  * False)
15537  * elif index is None: # <<<<<<<<<<<<<<
15538  * p_dst.shape[new_ndim] = 1
15539  * p_dst.strides[new_ndim] = 0
15540  */
15541  __pyx_t_2 = (__pyx_v_index == Py_None);
15542  __pyx_t_1 = (__pyx_t_2 != 0);
15543  if (__pyx_t_1) {
15544 
15545  /* "View.MemoryView":755
15546  * False)
15547  * elif index is None:
15548  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15549  * p_dst.strides[new_ndim] = 0
15550  * p_dst.suboffsets[new_ndim] = -1
15551  */
15552  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15553 
15554  /* "View.MemoryView":756
15555  * elif index is None:
15556  * p_dst.shape[new_ndim] = 1
15557  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15558  * p_dst.suboffsets[new_ndim] = -1
15559  * new_ndim += 1
15560  */
15561  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15562 
15563  /* "View.MemoryView":757
15564  * p_dst.shape[new_ndim] = 1
15565  * p_dst.strides[new_ndim] = 0
15566  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15567  * new_ndim += 1
15568  * else:
15569  */
15570  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15571 
15572  /* "View.MemoryView":758
15573  * p_dst.strides[new_ndim] = 0
15574  * p_dst.suboffsets[new_ndim] = -1
15575  * new_ndim += 1 # <<<<<<<<<<<<<<
15576  * else:
15577  * start = index.start or 0
15578  */
15579  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15580 
15581  /* "View.MemoryView":754
15582  * 0, 0, 0, # have_{start,stop,step}
15583  * False)
15584  * elif index is None: # <<<<<<<<<<<<<<
15585  * p_dst.shape[new_ndim] = 1
15586  * p_dst.strides[new_ndim] = 0
15587  */
15588  goto __pyx_L6;
15589  }
15590 
15591  /* "View.MemoryView":760
15592  * new_ndim += 1
15593  * else:
15594  * start = index.start or 0 # <<<<<<<<<<<<<<
15595  * stop = index.stop or 0
15596  * step = index.step or 0
15597  */
15598  /*else*/ {
15599  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15600  __Pyx_GOTREF(__pyx_t_9);
15601  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15602  if (!__pyx_t_1) {
15603  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15604  } else {
15605  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15606  __pyx_t_10 = __pyx_t_12;
15607  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15608  goto __pyx_L7_bool_binop_done;
15609  }
15610  __pyx_t_10 = 0;
15611  __pyx_L7_bool_binop_done:;
15612  __pyx_v_start = __pyx_t_10;
15613 
15614  /* "View.MemoryView":761
15615  * else:
15616  * start = index.start or 0
15617  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15618  * step = index.step or 0
15619  *
15620  */
15621  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15622  __Pyx_GOTREF(__pyx_t_9);
15623  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15624  if (!__pyx_t_1) {
15625  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15626  } else {
15627  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15628  __pyx_t_10 = __pyx_t_12;
15629  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15630  goto __pyx_L9_bool_binop_done;
15631  }
15632  __pyx_t_10 = 0;
15633  __pyx_L9_bool_binop_done:;
15634  __pyx_v_stop = __pyx_t_10;
15635 
15636  /* "View.MemoryView":762
15637  * start = index.start or 0
15638  * stop = index.stop or 0
15639  * step = index.step or 0 # <<<<<<<<<<<<<<
15640  *
15641  * have_start = index.start is not None
15642  */
15643  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15644  __Pyx_GOTREF(__pyx_t_9);
15645  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15646  if (!__pyx_t_1) {
15647  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15648  } else {
15649  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15650  __pyx_t_10 = __pyx_t_12;
15651  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15652  goto __pyx_L11_bool_binop_done;
15653  }
15654  __pyx_t_10 = 0;
15655  __pyx_L11_bool_binop_done:;
15656  __pyx_v_step = __pyx_t_10;
15657 
15658  /* "View.MemoryView":764
15659  * step = index.step or 0
15660  *
15661  * have_start = index.start is not None # <<<<<<<<<<<<<<
15662  * have_stop = index.stop is not None
15663  * have_step = index.step is not None
15664  */
15665  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15666  __Pyx_GOTREF(__pyx_t_9);
15667  __pyx_t_1 = (__pyx_t_9 != Py_None);
15668  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15669  __pyx_v_have_start = __pyx_t_1;
15670 
15671  /* "View.MemoryView":765
15672  *
15673  * have_start = index.start is not None
15674  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15675  * have_step = index.step is not None
15676  *
15677  */
15678  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15679  __Pyx_GOTREF(__pyx_t_9);
15680  __pyx_t_1 = (__pyx_t_9 != Py_None);
15681  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15682  __pyx_v_have_stop = __pyx_t_1;
15683 
15684  /* "View.MemoryView":766
15685  * have_start = index.start is not None
15686  * have_stop = index.stop is not None
15687  * have_step = index.step is not None # <<<<<<<<<<<<<<
15688  *
15689  * slice_memviewslice(
15690  */
15691  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15692  __Pyx_GOTREF(__pyx_t_9);
15693  __pyx_t_1 = (__pyx_t_9 != Py_None);
15694  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15695  __pyx_v_have_step = __pyx_t_1;
15696 
15697  /* "View.MemoryView":768
15698  * have_step = index.step is not None
15699  *
15700  * slice_memviewslice( # <<<<<<<<<<<<<<
15701  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15702  * dim, new_ndim, p_suboffset_dim,
15703  */
15704  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15705 
15706  /* "View.MemoryView":774
15707  * have_start, have_stop, have_step,
15708  * True)
15709  * new_ndim += 1 # <<<<<<<<<<<<<<
15710  *
15711  * if isinstance(memview, _memoryviewslice):
15712  */
15713  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15714  }
15715  __pyx_L6:;
15716 
15717  /* "View.MemoryView":746
15718  * cdef bint have_start, have_stop, have_step
15719  *
15720  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15721  * if PyIndex_Check(index):
15722  * slice_memviewslice(
15723  */
15724  }
15725  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15726 
15727  /* "View.MemoryView":776
15728  * new_ndim += 1
15729  *
15730  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15731  * return memoryview_fromslice(dst, new_ndim,
15732  * memviewsliceobj.to_object_func,
15733  */
15734  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15735  __pyx_t_2 = (__pyx_t_1 != 0);
15736  if (__pyx_t_2) {
15737 
15738  /* "View.MemoryView":777
15739  *
15740  * if isinstance(memview, _memoryviewslice):
15741  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15742  * memviewsliceobj.to_object_func,
15743  * memviewsliceobj.to_dtype_func,
15744  */
15745  __Pyx_XDECREF(((PyObject *)__pyx_r));
15746 
15747  /* "View.MemoryView":778
15748  * if isinstance(memview, _memoryviewslice):
15749  * return memoryview_fromslice(dst, new_ndim,
15750  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15751  * memviewsliceobj.to_dtype_func,
15752  * memview.dtype_is_object)
15753  */
15754  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15755 
15756  /* "View.MemoryView":779
15757  * return memoryview_fromslice(dst, new_ndim,
15758  * memviewsliceobj.to_object_func,
15759  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15760  * memview.dtype_is_object)
15761  * else:
15762  */
15763  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15764 
15765  /* "View.MemoryView":777
15766  *
15767  * if isinstance(memview, _memoryviewslice):
15768  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15769  * memviewsliceobj.to_object_func,
15770  * memviewsliceobj.to_dtype_func,
15771  */
15772  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15773  __Pyx_GOTREF(__pyx_t_3);
15774  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15775  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15776  __pyx_t_3 = 0;
15777  goto __pyx_L0;
15778 
15779  /* "View.MemoryView":776
15780  * new_ndim += 1
15781  *
15782  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15783  * return memoryview_fromslice(dst, new_ndim,
15784  * memviewsliceobj.to_object_func,
15785  */
15786  }
15787 
15788  /* "View.MemoryView":782
15789  * memview.dtype_is_object)
15790  * else:
15791  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15792  * memview.dtype_is_object)
15793  *
15794  */
15795  /*else*/ {
15796  __Pyx_XDECREF(((PyObject *)__pyx_r));
15797 
15798  /* "View.MemoryView":783
15799  * else:
15800  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15801  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15802  *
15803  *
15804  */
15805  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15806  __Pyx_GOTREF(__pyx_t_3);
15807 
15808  /* "View.MemoryView":782
15809  * memview.dtype_is_object)
15810  * else:
15811  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15812  * memview.dtype_is_object)
15813  *
15814  */
15815  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15816  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15817  __pyx_t_3 = 0;
15818  goto __pyx_L0;
15819  }
15820 
15821  /* "View.MemoryView":710
15822  *
15823  * @cname('__pyx_memview_slice')
15824  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15825  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15826  * cdef bint negative_step
15827  */
15828 
15829  /* function exit code */
15830  __pyx_L1_error:;
15831  __Pyx_XDECREF(__pyx_t_3);
15832  __Pyx_XDECREF(__pyx_t_9);
15833  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15834  __pyx_r = 0;
15835  __pyx_L0:;
15836  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15837  __Pyx_XDECREF(__pyx_v_index);
15838  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15839  __Pyx_RefNannyFinishContext();
15840  return __pyx_r;
15841 }
15842 
15843 /* "View.MemoryView":807
15844  *
15845  * @cname('__pyx_memoryview_slice_memviewslice')
15846  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15847  * __Pyx_memviewslice *dst,
15848  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15849  */
15850 
15851 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15852  Py_ssize_t __pyx_v_new_shape;
15853  int __pyx_v_negative_step;
15854  int __pyx_r;
15855  int __pyx_t_1;
15856  int __pyx_t_2;
15857  int __pyx_t_3;
15858  int __pyx_lineno = 0;
15859  const char *__pyx_filename = NULL;
15860  int __pyx_clineno = 0;
15861 
15862  /* "View.MemoryView":827
15863  * cdef bint negative_step
15864  *
15865  * if not is_slice: # <<<<<<<<<<<<<<
15866  *
15867  * if start < 0:
15868  */
15869  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15870  if (__pyx_t_1) {
15871 
15872  /* "View.MemoryView":829
15873  * if not is_slice:
15874  *
15875  * if start < 0: # <<<<<<<<<<<<<<
15876  * start += shape
15877  * if not 0 <= start < shape:
15878  */
15879  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15880  if (__pyx_t_1) {
15881 
15882  /* "View.MemoryView":830
15883  *
15884  * if start < 0:
15885  * start += shape # <<<<<<<<<<<<<<
15886  * if not 0 <= start < shape:
15887  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15888  */
15889  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15890 
15891  /* "View.MemoryView":829
15892  * if not is_slice:
15893  *
15894  * if start < 0: # <<<<<<<<<<<<<<
15895  * start += shape
15896  * if not 0 <= start < shape:
15897  */
15898  }
15899 
15900  /* "View.MemoryView":831
15901  * if start < 0:
15902  * start += shape
15903  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15904  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15905  * else:
15906  */
15907  __pyx_t_1 = (0 <= __pyx_v_start);
15908  if (__pyx_t_1) {
15909  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15910  }
15911  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15912  if (__pyx_t_2) {
15913 
15914  /* "View.MemoryView":832
15915  * start += shape
15916  * if not 0 <= start < shape:
15917  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15918  * else:
15919  *
15920  */
15921  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15922 
15923  /* "View.MemoryView":831
15924  * if start < 0:
15925  * start += shape
15926  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15927  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15928  * else:
15929  */
15930  }
15931 
15932  /* "View.MemoryView":827
15933  * cdef bint negative_step
15934  *
15935  * if not is_slice: # <<<<<<<<<<<<<<
15936  *
15937  * if start < 0:
15938  */
15939  goto __pyx_L3;
15940  }
15941 
15942  /* "View.MemoryView":835
15943  * else:
15944  *
15945  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15946  *
15947  * if have_step and step == 0:
15948  */
15949  /*else*/ {
15950  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15951  if (__pyx_t_1) {
15952  } else {
15953  __pyx_t_2 = __pyx_t_1;
15954  goto __pyx_L6_bool_binop_done;
15955  }
15956  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15957  __pyx_t_2 = __pyx_t_1;
15958  __pyx_L6_bool_binop_done:;
15959  __pyx_v_negative_step = __pyx_t_2;
15960 
15961  /* "View.MemoryView":837
15962  * negative_step = have_step != 0 and step < 0
15963  *
15964  * if have_step and step == 0: # <<<<<<<<<<<<<<
15965  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15966  *
15967  */
15968  __pyx_t_1 = (__pyx_v_have_step != 0);
15969  if (__pyx_t_1) {
15970  } else {
15971  __pyx_t_2 = __pyx_t_1;
15972  goto __pyx_L9_bool_binop_done;
15973  }
15974  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15975  __pyx_t_2 = __pyx_t_1;
15976  __pyx_L9_bool_binop_done:;
15977  if (__pyx_t_2) {
15978 
15979  /* "View.MemoryView":838
15980  *
15981  * if have_step and step == 0:
15982  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15983  *
15984  *
15985  */
15986  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15987 
15988  /* "View.MemoryView":837
15989  * negative_step = have_step != 0 and step < 0
15990  *
15991  * if have_step and step == 0: # <<<<<<<<<<<<<<
15992  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15993  *
15994  */
15995  }
15996 
15997  /* "View.MemoryView":841
15998  *
15999  *
16000  * if have_start: # <<<<<<<<<<<<<<
16001  * if start < 0:
16002  * start += shape
16003  */
16004  __pyx_t_2 = (__pyx_v_have_start != 0);
16005  if (__pyx_t_2) {
16006 
16007  /* "View.MemoryView":842
16008  *
16009  * if have_start:
16010  * if start < 0: # <<<<<<<<<<<<<<
16011  * start += shape
16012  * if start < 0:
16013  */
16014  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16015  if (__pyx_t_2) {
16016 
16017  /* "View.MemoryView":843
16018  * if have_start:
16019  * if start < 0:
16020  * start += shape # <<<<<<<<<<<<<<
16021  * if start < 0:
16022  * start = 0
16023  */
16024  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16025 
16026  /* "View.MemoryView":844
16027  * if start < 0:
16028  * start += shape
16029  * if start < 0: # <<<<<<<<<<<<<<
16030  * start = 0
16031  * elif start >= shape:
16032  */
16033  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16034  if (__pyx_t_2) {
16035 
16036  /* "View.MemoryView":845
16037  * start += shape
16038  * if start < 0:
16039  * start = 0 # <<<<<<<<<<<<<<
16040  * elif start >= shape:
16041  * if negative_step:
16042  */
16043  __pyx_v_start = 0;
16044 
16045  /* "View.MemoryView":844
16046  * if start < 0:
16047  * start += shape
16048  * if start < 0: # <<<<<<<<<<<<<<
16049  * start = 0
16050  * elif start >= shape:
16051  */
16052  }
16053 
16054  /* "View.MemoryView":842
16055  *
16056  * if have_start:
16057  * if start < 0: # <<<<<<<<<<<<<<
16058  * start += shape
16059  * if start < 0:
16060  */
16061  goto __pyx_L12;
16062  }
16063 
16064  /* "View.MemoryView":846
16065  * if start < 0:
16066  * start = 0
16067  * elif start >= shape: # <<<<<<<<<<<<<<
16068  * if negative_step:
16069  * start = shape - 1
16070  */
16071  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16072  if (__pyx_t_2) {
16073 
16074  /* "View.MemoryView":847
16075  * start = 0
16076  * elif start >= shape:
16077  * if negative_step: # <<<<<<<<<<<<<<
16078  * start = shape - 1
16079  * else:
16080  */
16081  __pyx_t_2 = (__pyx_v_negative_step != 0);
16082  if (__pyx_t_2) {
16083 
16084  /* "View.MemoryView":848
16085  * elif start >= shape:
16086  * if negative_step:
16087  * start = shape - 1 # <<<<<<<<<<<<<<
16088  * else:
16089  * start = shape
16090  */
16091  __pyx_v_start = (__pyx_v_shape - 1);
16092 
16093  /* "View.MemoryView":847
16094  * start = 0
16095  * elif start >= shape:
16096  * if negative_step: # <<<<<<<<<<<<<<
16097  * start = shape - 1
16098  * else:
16099  */
16100  goto __pyx_L14;
16101  }
16102 
16103  /* "View.MemoryView":850
16104  * start = shape - 1
16105  * else:
16106  * start = shape # <<<<<<<<<<<<<<
16107  * else:
16108  * if negative_step:
16109  */
16110  /*else*/ {
16111  __pyx_v_start = __pyx_v_shape;
16112  }
16113  __pyx_L14:;
16114 
16115  /* "View.MemoryView":846
16116  * if start < 0:
16117  * start = 0
16118  * elif start >= shape: # <<<<<<<<<<<<<<
16119  * if negative_step:
16120  * start = shape - 1
16121  */
16122  }
16123  __pyx_L12:;
16124 
16125  /* "View.MemoryView":841
16126  *
16127  *
16128  * if have_start: # <<<<<<<<<<<<<<
16129  * if start < 0:
16130  * start += shape
16131  */
16132  goto __pyx_L11;
16133  }
16134 
16135  /* "View.MemoryView":852
16136  * start = shape
16137  * else:
16138  * if negative_step: # <<<<<<<<<<<<<<
16139  * start = shape - 1
16140  * else:
16141  */
16142  /*else*/ {
16143  __pyx_t_2 = (__pyx_v_negative_step != 0);
16144  if (__pyx_t_2) {
16145 
16146  /* "View.MemoryView":853
16147  * else:
16148  * if negative_step:
16149  * start = shape - 1 # <<<<<<<<<<<<<<
16150  * else:
16151  * start = 0
16152  */
16153  __pyx_v_start = (__pyx_v_shape - 1);
16154 
16155  /* "View.MemoryView":852
16156  * start = shape
16157  * else:
16158  * if negative_step: # <<<<<<<<<<<<<<
16159  * start = shape - 1
16160  * else:
16161  */
16162  goto __pyx_L15;
16163  }
16164 
16165  /* "View.MemoryView":855
16166  * start = shape - 1
16167  * else:
16168  * start = 0 # <<<<<<<<<<<<<<
16169  *
16170  * if have_stop:
16171  */
16172  /*else*/ {
16173  __pyx_v_start = 0;
16174  }
16175  __pyx_L15:;
16176  }
16177  __pyx_L11:;
16178 
16179  /* "View.MemoryView":857
16180  * start = 0
16181  *
16182  * if have_stop: # <<<<<<<<<<<<<<
16183  * if stop < 0:
16184  * stop += shape
16185  */
16186  __pyx_t_2 = (__pyx_v_have_stop != 0);
16187  if (__pyx_t_2) {
16188 
16189  /* "View.MemoryView":858
16190  *
16191  * if have_stop:
16192  * if stop < 0: # <<<<<<<<<<<<<<
16193  * stop += shape
16194  * if stop < 0:
16195  */
16196  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16197  if (__pyx_t_2) {
16198 
16199  /* "View.MemoryView":859
16200  * if have_stop:
16201  * if stop < 0:
16202  * stop += shape # <<<<<<<<<<<<<<
16203  * if stop < 0:
16204  * stop = 0
16205  */
16206  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16207 
16208  /* "View.MemoryView":860
16209  * if stop < 0:
16210  * stop += shape
16211  * if stop < 0: # <<<<<<<<<<<<<<
16212  * stop = 0
16213  * elif stop > shape:
16214  */
16215  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16216  if (__pyx_t_2) {
16217 
16218  /* "View.MemoryView":861
16219  * stop += shape
16220  * if stop < 0:
16221  * stop = 0 # <<<<<<<<<<<<<<
16222  * elif stop > shape:
16223  * stop = shape
16224  */
16225  __pyx_v_stop = 0;
16226 
16227  /* "View.MemoryView":860
16228  * if stop < 0:
16229  * stop += shape
16230  * if stop < 0: # <<<<<<<<<<<<<<
16231  * stop = 0
16232  * elif stop > shape:
16233  */
16234  }
16235 
16236  /* "View.MemoryView":858
16237  *
16238  * if have_stop:
16239  * if stop < 0: # <<<<<<<<<<<<<<
16240  * stop += shape
16241  * if stop < 0:
16242  */
16243  goto __pyx_L17;
16244  }
16245 
16246  /* "View.MemoryView":862
16247  * if stop < 0:
16248  * stop = 0
16249  * elif stop > shape: # <<<<<<<<<<<<<<
16250  * stop = shape
16251  * else:
16252  */
16253  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16254  if (__pyx_t_2) {
16255 
16256  /* "View.MemoryView":863
16257  * stop = 0
16258  * elif stop > shape:
16259  * stop = shape # <<<<<<<<<<<<<<
16260  * else:
16261  * if negative_step:
16262  */
16263  __pyx_v_stop = __pyx_v_shape;
16264 
16265  /* "View.MemoryView":862
16266  * if stop < 0:
16267  * stop = 0
16268  * elif stop > shape: # <<<<<<<<<<<<<<
16269  * stop = shape
16270  * else:
16271  */
16272  }
16273  __pyx_L17:;
16274 
16275  /* "View.MemoryView":857
16276  * start = 0
16277  *
16278  * if have_stop: # <<<<<<<<<<<<<<
16279  * if stop < 0:
16280  * stop += shape
16281  */
16282  goto __pyx_L16;
16283  }
16284 
16285  /* "View.MemoryView":865
16286  * stop = shape
16287  * else:
16288  * if negative_step: # <<<<<<<<<<<<<<
16289  * stop = -1
16290  * else:
16291  */
16292  /*else*/ {
16293  __pyx_t_2 = (__pyx_v_negative_step != 0);
16294  if (__pyx_t_2) {
16295 
16296  /* "View.MemoryView":866
16297  * else:
16298  * if negative_step:
16299  * stop = -1 # <<<<<<<<<<<<<<
16300  * else:
16301  * stop = shape
16302  */
16303  __pyx_v_stop = -1L;
16304 
16305  /* "View.MemoryView":865
16306  * stop = shape
16307  * else:
16308  * if negative_step: # <<<<<<<<<<<<<<
16309  * stop = -1
16310  * else:
16311  */
16312  goto __pyx_L19;
16313  }
16314 
16315  /* "View.MemoryView":868
16316  * stop = -1
16317  * else:
16318  * stop = shape # <<<<<<<<<<<<<<
16319  *
16320  * if not have_step:
16321  */
16322  /*else*/ {
16323  __pyx_v_stop = __pyx_v_shape;
16324  }
16325  __pyx_L19:;
16326  }
16327  __pyx_L16:;
16328 
16329  /* "View.MemoryView":870
16330  * stop = shape
16331  *
16332  * if not have_step: # <<<<<<<<<<<<<<
16333  * step = 1
16334  *
16335  */
16336  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16337  if (__pyx_t_2) {
16338 
16339  /* "View.MemoryView":871
16340  *
16341  * if not have_step:
16342  * step = 1 # <<<<<<<<<<<<<<
16343  *
16344  *
16345  */
16346  __pyx_v_step = 1;
16347 
16348  /* "View.MemoryView":870
16349  * stop = shape
16350  *
16351  * if not have_step: # <<<<<<<<<<<<<<
16352  * step = 1
16353  *
16354  */
16355  }
16356 
16357  /* "View.MemoryView":875
16358  *
16359  * with cython.cdivision(True):
16360  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16361  *
16362  * if (stop - start) - step * new_shape:
16363  */
16364  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16365 
16366  /* "View.MemoryView":877
16367  * new_shape = (stop - start) // step
16368  *
16369  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16370  * new_shape += 1
16371  *
16372  */
16373  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16374  if (__pyx_t_2) {
16375 
16376  /* "View.MemoryView":878
16377  *
16378  * if (stop - start) - step * new_shape:
16379  * new_shape += 1 # <<<<<<<<<<<<<<
16380  *
16381  * if new_shape < 0:
16382  */
16383  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16384 
16385  /* "View.MemoryView":877
16386  * new_shape = (stop - start) // step
16387  *
16388  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16389  * new_shape += 1
16390  *
16391  */
16392  }
16393 
16394  /* "View.MemoryView":880
16395  * new_shape += 1
16396  *
16397  * if new_shape < 0: # <<<<<<<<<<<<<<
16398  * new_shape = 0
16399  *
16400  */
16401  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16402  if (__pyx_t_2) {
16403 
16404  /* "View.MemoryView":881
16405  *
16406  * if new_shape < 0:
16407  * new_shape = 0 # <<<<<<<<<<<<<<
16408  *
16409  *
16410  */
16411  __pyx_v_new_shape = 0;
16412 
16413  /* "View.MemoryView":880
16414  * new_shape += 1
16415  *
16416  * if new_shape < 0: # <<<<<<<<<<<<<<
16417  * new_shape = 0
16418  *
16419  */
16420  }
16421 
16422  /* "View.MemoryView":884
16423  *
16424  *
16425  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16426  * dst.shape[new_ndim] = new_shape
16427  * dst.suboffsets[new_ndim] = suboffset
16428  */
16429  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16430 
16431  /* "View.MemoryView":885
16432  *
16433  * dst.strides[new_ndim] = stride * step
16434  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16435  * dst.suboffsets[new_ndim] = suboffset
16436  *
16437  */
16438  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16439 
16440  /* "View.MemoryView":886
16441  * dst.strides[new_ndim] = stride * step
16442  * dst.shape[new_ndim] = new_shape
16443  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16444  *
16445  *
16446  */
16447  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16448  }
16449  __pyx_L3:;
16450 
16451  /* "View.MemoryView":889
16452  *
16453  *
16454  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16455  * dst.data += start * stride
16456  * else:
16457  */
16458  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16459  if (__pyx_t_2) {
16460 
16461  /* "View.MemoryView":890
16462  *
16463  * if suboffset_dim[0] < 0:
16464  * dst.data += start * stride # <<<<<<<<<<<<<<
16465  * else:
16466  * dst.suboffsets[suboffset_dim[0]] += start * stride
16467  */
16468  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16469 
16470  /* "View.MemoryView":889
16471  *
16472  *
16473  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16474  * dst.data += start * stride
16475  * else:
16476  */
16477  goto __pyx_L23;
16478  }
16479 
16480  /* "View.MemoryView":892
16481  * dst.data += start * stride
16482  * else:
16483  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16484  *
16485  * if suboffset >= 0:
16486  */
16487  /*else*/ {
16488  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16489  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16490  }
16491  __pyx_L23:;
16492 
16493  /* "View.MemoryView":894
16494  * dst.suboffsets[suboffset_dim[0]] += start * stride
16495  *
16496  * if suboffset >= 0: # <<<<<<<<<<<<<<
16497  * if not is_slice:
16498  * if new_ndim == 0:
16499  */
16500  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16501  if (__pyx_t_2) {
16502 
16503  /* "View.MemoryView":895
16504  *
16505  * if suboffset >= 0:
16506  * if not is_slice: # <<<<<<<<<<<<<<
16507  * if new_ndim == 0:
16508  * dst.data = (<char **> dst.data)[0] + suboffset
16509  */
16510  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16511  if (__pyx_t_2) {
16512 
16513  /* "View.MemoryView":896
16514  * if suboffset >= 0:
16515  * if not is_slice:
16516  * if new_ndim == 0: # <<<<<<<<<<<<<<
16517  * dst.data = (<char **> dst.data)[0] + suboffset
16518  * else:
16519  */
16520  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16521  if (__pyx_t_2) {
16522 
16523  /* "View.MemoryView":897
16524  * if not is_slice:
16525  * if new_ndim == 0:
16526  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16527  * else:
16528  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16529  */
16530  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16531 
16532  /* "View.MemoryView":896
16533  * if suboffset >= 0:
16534  * if not is_slice:
16535  * if new_ndim == 0: # <<<<<<<<<<<<<<
16536  * dst.data = (<char **> dst.data)[0] + suboffset
16537  * else:
16538  */
16539  goto __pyx_L26;
16540  }
16541 
16542  /* "View.MemoryView":899
16543  * dst.data = (<char **> dst.data)[0] + suboffset
16544  * else:
16545  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16546  * "must be indexed and not sliced", dim)
16547  * else:
16548  */
16549  /*else*/ {
16550 
16551  /* "View.MemoryView":900
16552  * else:
16553  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16554  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16555  * else:
16556  * suboffset_dim[0] = new_ndim
16557  */
16558  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16559  }
16560  __pyx_L26:;
16561 
16562  /* "View.MemoryView":895
16563  *
16564  * if suboffset >= 0:
16565  * if not is_slice: # <<<<<<<<<<<<<<
16566  * if new_ndim == 0:
16567  * dst.data = (<char **> dst.data)[0] + suboffset
16568  */
16569  goto __pyx_L25;
16570  }
16571 
16572  /* "View.MemoryView":902
16573  * "must be indexed and not sliced", dim)
16574  * else:
16575  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16576  *
16577  * return 0
16578  */
16579  /*else*/ {
16580  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16581  }
16582  __pyx_L25:;
16583 
16584  /* "View.MemoryView":894
16585  * dst.suboffsets[suboffset_dim[0]] += start * stride
16586  *
16587  * if suboffset >= 0: # <<<<<<<<<<<<<<
16588  * if not is_slice:
16589  * if new_ndim == 0:
16590  */
16591  }
16592 
16593  /* "View.MemoryView":904
16594  * suboffset_dim[0] = new_ndim
16595  *
16596  * return 0 # <<<<<<<<<<<<<<
16597  *
16598  *
16599  */
16600  __pyx_r = 0;
16601  goto __pyx_L0;
16602 
16603  /* "View.MemoryView":807
16604  *
16605  * @cname('__pyx_memoryview_slice_memviewslice')
16606  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16607  * __Pyx_memviewslice *dst,
16608  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16609  */
16610 
16611  /* function exit code */
16612  __pyx_L1_error:;
16613  {
16614  #ifdef WITH_THREAD
16615  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16616  #endif
16617  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16618  #ifdef WITH_THREAD
16619  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16620  #endif
16621  }
16622  __pyx_r = -1;
16623  __pyx_L0:;
16624  return __pyx_r;
16625 }
16626 
16627 /* "View.MemoryView":910
16628  *
16629  * @cname('__pyx_pybuffer_index')
16630  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16631  * Py_ssize_t dim) except NULL:
16632  * cdef Py_ssize_t shape, stride, suboffset = -1
16633  */
16634 
16635 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16636  Py_ssize_t __pyx_v_shape;
16637  Py_ssize_t __pyx_v_stride;
16638  Py_ssize_t __pyx_v_suboffset;
16639  Py_ssize_t __pyx_v_itemsize;
16640  char *__pyx_v_resultp;
16641  char *__pyx_r;
16642  __Pyx_RefNannyDeclarations
16643  Py_ssize_t __pyx_t_1;
16644  int __pyx_t_2;
16645  PyObject *__pyx_t_3 = NULL;
16646  PyObject *__pyx_t_4 = NULL;
16647  int __pyx_lineno = 0;
16648  const char *__pyx_filename = NULL;
16649  int __pyx_clineno = 0;
16650  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16651 
16652  /* "View.MemoryView":912
16653  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16654  * Py_ssize_t dim) except NULL:
16655  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16656  * cdef Py_ssize_t itemsize = view.itemsize
16657  * cdef char *resultp
16658  */
16659  __pyx_v_suboffset = -1L;
16660 
16661  /* "View.MemoryView":913
16662  * Py_ssize_t dim) except NULL:
16663  * cdef Py_ssize_t shape, stride, suboffset = -1
16664  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16665  * cdef char *resultp
16666  *
16667  */
16668  __pyx_t_1 = __pyx_v_view->itemsize;
16669  __pyx_v_itemsize = __pyx_t_1;
16670 
16671  /* "View.MemoryView":916
16672  * cdef char *resultp
16673  *
16674  * if view.ndim == 0: # <<<<<<<<<<<<<<
16675  * shape = view.len / itemsize
16676  * stride = itemsize
16677  */
16678  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16679  if (__pyx_t_2) {
16680 
16681  /* "View.MemoryView":917
16682  *
16683  * if view.ndim == 0:
16684  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16685  * stride = itemsize
16686  * else:
16687  */
16688  if (unlikely(__pyx_v_itemsize == 0)) {
16689  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16690  __PYX_ERR(1, 917, __pyx_L1_error)
16691  }
16692  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16693  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16694  __PYX_ERR(1, 917, __pyx_L1_error)
16695  }
16696  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16697 
16698  /* "View.MemoryView":918
16699  * if view.ndim == 0:
16700  * shape = view.len / itemsize
16701  * stride = itemsize # <<<<<<<<<<<<<<
16702  * else:
16703  * shape = view.shape[dim]
16704  */
16705  __pyx_v_stride = __pyx_v_itemsize;
16706 
16707  /* "View.MemoryView":916
16708  * cdef char *resultp
16709  *
16710  * if view.ndim == 0: # <<<<<<<<<<<<<<
16711  * shape = view.len / itemsize
16712  * stride = itemsize
16713  */
16714  goto __pyx_L3;
16715  }
16716 
16717  /* "View.MemoryView":920
16718  * stride = itemsize
16719  * else:
16720  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16721  * stride = view.strides[dim]
16722  * if view.suboffsets != NULL:
16723  */
16724  /*else*/ {
16725  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16726 
16727  /* "View.MemoryView":921
16728  * else:
16729  * shape = view.shape[dim]
16730  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16731  * if view.suboffsets != NULL:
16732  * suboffset = view.suboffsets[dim]
16733  */
16734  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16735 
16736  /* "View.MemoryView":922
16737  * shape = view.shape[dim]
16738  * stride = view.strides[dim]
16739  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16740  * suboffset = view.suboffsets[dim]
16741  *
16742  */
16743  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16744  if (__pyx_t_2) {
16745 
16746  /* "View.MemoryView":923
16747  * stride = view.strides[dim]
16748  * if view.suboffsets != NULL:
16749  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16750  *
16751  * if index < 0:
16752  */
16753  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16754 
16755  /* "View.MemoryView":922
16756  * shape = view.shape[dim]
16757  * stride = view.strides[dim]
16758  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16759  * suboffset = view.suboffsets[dim]
16760  *
16761  */
16762  }
16763  }
16764  __pyx_L3:;
16765 
16766  /* "View.MemoryView":925
16767  * suboffset = view.suboffsets[dim]
16768  *
16769  * if index < 0: # <<<<<<<<<<<<<<
16770  * index += view.shape[dim]
16771  * if index < 0:
16772  */
16773  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16774  if (__pyx_t_2) {
16775 
16776  /* "View.MemoryView":926
16777  *
16778  * if index < 0:
16779  * index += view.shape[dim] # <<<<<<<<<<<<<<
16780  * if index < 0:
16781  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16782  */
16783  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16784 
16785  /* "View.MemoryView":927
16786  * if index < 0:
16787  * index += view.shape[dim]
16788  * if index < 0: # <<<<<<<<<<<<<<
16789  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16790  *
16791  */
16792  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16793  if (unlikely(__pyx_t_2)) {
16794 
16795  /* "View.MemoryView":928
16796  * index += view.shape[dim]
16797  * if index < 0:
16798  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16799  *
16800  * if index >= shape:
16801  */
16802  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16803  __Pyx_GOTREF(__pyx_t_3);
16804  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16805  __Pyx_GOTREF(__pyx_t_4);
16806  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16807  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16808  __Pyx_GOTREF(__pyx_t_3);
16809  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16810  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16811  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16812  __PYX_ERR(1, 928, __pyx_L1_error)
16813 
16814  /* "View.MemoryView":927
16815  * if index < 0:
16816  * index += view.shape[dim]
16817  * if index < 0: # <<<<<<<<<<<<<<
16818  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16819  *
16820  */
16821  }
16822 
16823  /* "View.MemoryView":925
16824  * suboffset = view.suboffsets[dim]
16825  *
16826  * if index < 0: # <<<<<<<<<<<<<<
16827  * index += view.shape[dim]
16828  * if index < 0:
16829  */
16830  }
16831 
16832  /* "View.MemoryView":930
16833  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16834  *
16835  * if index >= shape: # <<<<<<<<<<<<<<
16836  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16837  *
16838  */
16839  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16840  if (unlikely(__pyx_t_2)) {
16841 
16842  /* "View.MemoryView":931
16843  *
16844  * if index >= shape:
16845  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16846  *
16847  * resultp = bufp + index * stride
16848  */
16849  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16850  __Pyx_GOTREF(__pyx_t_3);
16851  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16852  __Pyx_GOTREF(__pyx_t_4);
16853  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16854  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16855  __Pyx_GOTREF(__pyx_t_3);
16856  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16857  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16858  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16859  __PYX_ERR(1, 931, __pyx_L1_error)
16860 
16861  /* "View.MemoryView":930
16862  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16863  *
16864  * if index >= shape: # <<<<<<<<<<<<<<
16865  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16866  *
16867  */
16868  }
16869 
16870  /* "View.MemoryView":933
16871  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16872  *
16873  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16874  * if suboffset >= 0:
16875  * resultp = (<char **> resultp)[0] + suboffset
16876  */
16877  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16878 
16879  /* "View.MemoryView":934
16880  *
16881  * resultp = bufp + index * stride
16882  * if suboffset >= 0: # <<<<<<<<<<<<<<
16883  * resultp = (<char **> resultp)[0] + suboffset
16884  *
16885  */
16886  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16887  if (__pyx_t_2) {
16888 
16889  /* "View.MemoryView":935
16890  * resultp = bufp + index * stride
16891  * if suboffset >= 0:
16892  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16893  *
16894  * return resultp
16895  */
16896  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16897 
16898  /* "View.MemoryView":934
16899  *
16900  * resultp = bufp + index * stride
16901  * if suboffset >= 0: # <<<<<<<<<<<<<<
16902  * resultp = (<char **> resultp)[0] + suboffset
16903  *
16904  */
16905  }
16906 
16907  /* "View.MemoryView":937
16908  * resultp = (<char **> resultp)[0] + suboffset
16909  *
16910  * return resultp # <<<<<<<<<<<<<<
16911  *
16912  *
16913  */
16914  __pyx_r = __pyx_v_resultp;
16915  goto __pyx_L0;
16916 
16917  /* "View.MemoryView":910
16918  *
16919  * @cname('__pyx_pybuffer_index')
16920  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16921  * Py_ssize_t dim) except NULL:
16922  * cdef Py_ssize_t shape, stride, suboffset = -1
16923  */
16924 
16925  /* function exit code */
16926  __pyx_L1_error:;
16927  __Pyx_XDECREF(__pyx_t_3);
16928  __Pyx_XDECREF(__pyx_t_4);
16929  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16930  __pyx_r = NULL;
16931  __pyx_L0:;
16932  __Pyx_RefNannyFinishContext();
16933  return __pyx_r;
16934 }
16935 
16936 /* "View.MemoryView":943
16937  *
16938  * @cname('__pyx_memslice_transpose')
16939  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16940  * cdef int ndim = memslice.memview.view.ndim
16941  *
16942  */
16943 
16944 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16945  int __pyx_v_ndim;
16946  Py_ssize_t *__pyx_v_shape;
16947  Py_ssize_t *__pyx_v_strides;
16948  int __pyx_v_i;
16949  int __pyx_v_j;
16950  int __pyx_r;
16951  int __pyx_t_1;
16952  Py_ssize_t *__pyx_t_2;
16953  long __pyx_t_3;
16954  long __pyx_t_4;
16955  Py_ssize_t __pyx_t_5;
16956  Py_ssize_t __pyx_t_6;
16957  int __pyx_t_7;
16958  int __pyx_t_8;
16959  int __pyx_t_9;
16960  int __pyx_lineno = 0;
16961  const char *__pyx_filename = NULL;
16962  int __pyx_clineno = 0;
16963 
16964  /* "View.MemoryView":944
16965  * @cname('__pyx_memslice_transpose')
16966  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16967  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16968  *
16969  * cdef Py_ssize_t *shape = memslice.shape
16970  */
16971  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16972  __pyx_v_ndim = __pyx_t_1;
16973 
16974  /* "View.MemoryView":946
16975  * cdef int ndim = memslice.memview.view.ndim
16976  *
16977  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16978  * cdef Py_ssize_t *strides = memslice.strides
16979  *
16980  */
16981  __pyx_t_2 = __pyx_v_memslice->shape;
16982  __pyx_v_shape = __pyx_t_2;
16983 
16984  /* "View.MemoryView":947
16985  *
16986  * cdef Py_ssize_t *shape = memslice.shape
16987  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16988  *
16989  *
16990  */
16991  __pyx_t_2 = __pyx_v_memslice->strides;
16992  __pyx_v_strides = __pyx_t_2;
16993 
16994  /* "View.MemoryView":951
16995  *
16996  * cdef int i, j
16997  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16998  * j = ndim - 1 - i
16999  * strides[i], strides[j] = strides[j], strides[i]
17000  */
17001  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17002  __pyx_t_4 = __pyx_t_3;
17003  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17004  __pyx_v_i = __pyx_t_1;
17005 
17006  /* "View.MemoryView":952
17007  * cdef int i, j
17008  * for i in range(ndim / 2):
17009  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17010  * strides[i], strides[j] = strides[j], strides[i]
17011  * shape[i], shape[j] = shape[j], shape[i]
17012  */
17013  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17014 
17015  /* "View.MemoryView":953
17016  * for i in range(ndim / 2):
17017  * j = ndim - 1 - i
17018  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17019  * shape[i], shape[j] = shape[j], shape[i]
17020  *
17021  */
17022  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17023  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17024  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17025  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17026 
17027  /* "View.MemoryView":954
17028  * j = ndim - 1 - i
17029  * strides[i], strides[j] = strides[j], strides[i]
17030  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17031  *
17032  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17033  */
17034  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17035  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17036  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17037  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17038 
17039  /* "View.MemoryView":956
17040  * shape[i], shape[j] = shape[j], shape[i]
17041  *
17042  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17043  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17044  *
17045  */
17046  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17047  if (!__pyx_t_8) {
17048  } else {
17049  __pyx_t_7 = __pyx_t_8;
17050  goto __pyx_L6_bool_binop_done;
17051  }
17052  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17053  __pyx_t_7 = __pyx_t_8;
17054  __pyx_L6_bool_binop_done:;
17055  if (__pyx_t_7) {
17056 
17057  /* "View.MemoryView":957
17058  *
17059  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17060  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17061  *
17062  * return 1
17063  */
17064  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17065 
17066  /* "View.MemoryView":956
17067  * shape[i], shape[j] = shape[j], shape[i]
17068  *
17069  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17070  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17071  *
17072  */
17073  }
17074  }
17075 
17076  /* "View.MemoryView":959
17077  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17078  *
17079  * return 1 # <<<<<<<<<<<<<<
17080  *
17081  *
17082  */
17083  __pyx_r = 1;
17084  goto __pyx_L0;
17085 
17086  /* "View.MemoryView":943
17087  *
17088  * @cname('__pyx_memslice_transpose')
17089  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17090  * cdef int ndim = memslice.memview.view.ndim
17091  *
17092  */
17093 
17094  /* function exit code */
17095  __pyx_L1_error:;
17096  {
17097  #ifdef WITH_THREAD
17098  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17099  #endif
17100  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17101  #ifdef WITH_THREAD
17102  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17103  #endif
17104  }
17105  __pyx_r = 0;
17106  __pyx_L0:;
17107  return __pyx_r;
17108 }
17109 
17110 /* "View.MemoryView":976
17111  * cdef int (*to_dtype_func)(char *, object) except 0
17112  *
17113  * def __dealloc__(self): # <<<<<<<<<<<<<<
17114  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17115  *
17116  */
17117 
17118 /* Python wrapper */
17119 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17120 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17121  __Pyx_RefNannyDeclarations
17122  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17123  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17124 
17125  /* function exit code */
17126  __Pyx_RefNannyFinishContext();
17127 }
17128 
17129 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17130  __Pyx_RefNannyDeclarations
17131  __Pyx_RefNannySetupContext("__dealloc__", 0);
17132 
17133  /* "View.MemoryView":977
17134  *
17135  * def __dealloc__(self):
17136  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17137  *
17138  * cdef convert_item_to_object(self, char *itemp):
17139  */
17140  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17141 
17142  /* "View.MemoryView":976
17143  * cdef int (*to_dtype_func)(char *, object) except 0
17144  *
17145  * def __dealloc__(self): # <<<<<<<<<<<<<<
17146  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17147  *
17148  */
17149 
17150  /* function exit code */
17151  __Pyx_RefNannyFinishContext();
17152 }
17153 
17154 /* "View.MemoryView":979
17155  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17156  *
17157  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17158  * if self.to_object_func != NULL:
17159  * return self.to_object_func(itemp)
17160  */
17161 
17162 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17163  PyObject *__pyx_r = NULL;
17164  __Pyx_RefNannyDeclarations
17165  int __pyx_t_1;
17166  PyObject *__pyx_t_2 = NULL;
17167  int __pyx_lineno = 0;
17168  const char *__pyx_filename = NULL;
17169  int __pyx_clineno = 0;
17170  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17171 
17172  /* "View.MemoryView":980
17173  *
17174  * cdef convert_item_to_object(self, char *itemp):
17175  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17176  * return self.to_object_func(itemp)
17177  * else:
17178  */
17179  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17180  if (__pyx_t_1) {
17181 
17182  /* "View.MemoryView":981
17183  * cdef convert_item_to_object(self, char *itemp):
17184  * if self.to_object_func != NULL:
17185  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17186  * else:
17187  * return memoryview.convert_item_to_object(self, itemp)
17188  */
17189  __Pyx_XDECREF(__pyx_r);
17190  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17191  __Pyx_GOTREF(__pyx_t_2);
17192  __pyx_r = __pyx_t_2;
17193  __pyx_t_2 = 0;
17194  goto __pyx_L0;
17195 
17196  /* "View.MemoryView":980
17197  *
17198  * cdef convert_item_to_object(self, char *itemp):
17199  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17200  * return self.to_object_func(itemp)
17201  * else:
17202  */
17203  }
17204 
17205  /* "View.MemoryView":983
17206  * return self.to_object_func(itemp)
17207  * else:
17208  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17209  *
17210  * cdef assign_item_from_object(self, char *itemp, object value):
17211  */
17212  /*else*/ {
17213  __Pyx_XDECREF(__pyx_r);
17214  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17215  __Pyx_GOTREF(__pyx_t_2);
17216  __pyx_r = __pyx_t_2;
17217  __pyx_t_2 = 0;
17218  goto __pyx_L0;
17219  }
17220 
17221  /* "View.MemoryView":979
17222  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17223  *
17224  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17225  * if self.to_object_func != NULL:
17226  * return self.to_object_func(itemp)
17227  */
17228 
17229  /* function exit code */
17230  __pyx_L1_error:;
17231  __Pyx_XDECREF(__pyx_t_2);
17232  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17233  __pyx_r = 0;
17234  __pyx_L0:;
17235  __Pyx_XGIVEREF(__pyx_r);
17236  __Pyx_RefNannyFinishContext();
17237  return __pyx_r;
17238 }
17239 
17240 /* "View.MemoryView":985
17241  * return memoryview.convert_item_to_object(self, itemp)
17242  *
17243  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17244  * if self.to_dtype_func != NULL:
17245  * self.to_dtype_func(itemp, value)
17246  */
17247 
17248 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17249  PyObject *__pyx_r = NULL;
17250  __Pyx_RefNannyDeclarations
17251  int __pyx_t_1;
17252  int __pyx_t_2;
17253  PyObject *__pyx_t_3 = NULL;
17254  int __pyx_lineno = 0;
17255  const char *__pyx_filename = NULL;
17256  int __pyx_clineno = 0;
17257  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17258 
17259  /* "View.MemoryView":986
17260  *
17261  * cdef assign_item_from_object(self, char *itemp, object value):
17262  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17263  * self.to_dtype_func(itemp, value)
17264  * else:
17265  */
17266  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17267  if (__pyx_t_1) {
17268 
17269  /* "View.MemoryView":987
17270  * cdef assign_item_from_object(self, char *itemp, object value):
17271  * if self.to_dtype_func != NULL:
17272  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17273  * else:
17274  * memoryview.assign_item_from_object(self, itemp, value)
17275  */
17276  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17277 
17278  /* "View.MemoryView":986
17279  *
17280  * cdef assign_item_from_object(self, char *itemp, object value):
17281  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17282  * self.to_dtype_func(itemp, value)
17283  * else:
17284  */
17285  goto __pyx_L3;
17286  }
17287 
17288  /* "View.MemoryView":989
17289  * self.to_dtype_func(itemp, value)
17290  * else:
17291  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17292  *
17293  * @property
17294  */
17295  /*else*/ {
17296  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17297  __Pyx_GOTREF(__pyx_t_3);
17298  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17299  }
17300  __pyx_L3:;
17301 
17302  /* "View.MemoryView":985
17303  * return memoryview.convert_item_to_object(self, itemp)
17304  *
17305  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17306  * if self.to_dtype_func != NULL:
17307  * self.to_dtype_func(itemp, value)
17308  */
17309 
17310  /* function exit code */
17311  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17312  goto __pyx_L0;
17313  __pyx_L1_error:;
17314  __Pyx_XDECREF(__pyx_t_3);
17315  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17316  __pyx_r = 0;
17317  __pyx_L0:;
17318  __Pyx_XGIVEREF(__pyx_r);
17319  __Pyx_RefNannyFinishContext();
17320  return __pyx_r;
17321 }
17322 
17323 /* "View.MemoryView":992
17324  *
17325  * @property
17326  * def base(self): # <<<<<<<<<<<<<<
17327  * return self.from_object
17328  *
17329  */
17330 
17331 /* Python wrapper */
17332 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17333 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17334  PyObject *__pyx_r = 0;
17335  __Pyx_RefNannyDeclarations
17336  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17337  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17338 
17339  /* function exit code */
17340  __Pyx_RefNannyFinishContext();
17341  return __pyx_r;
17342 }
17343 
17344 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17345  PyObject *__pyx_r = NULL;
17346  __Pyx_RefNannyDeclarations
17347  __Pyx_RefNannySetupContext("__get__", 0);
17348 
17349  /* "View.MemoryView":993
17350  * @property
17351  * def base(self):
17352  * return self.from_object # <<<<<<<<<<<<<<
17353  *
17354  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17355  */
17356  __Pyx_XDECREF(__pyx_r);
17357  __Pyx_INCREF(__pyx_v_self->from_object);
17358  __pyx_r = __pyx_v_self->from_object;
17359  goto __pyx_L0;
17360 
17361  /* "View.MemoryView":992
17362  *
17363  * @property
17364  * def base(self): # <<<<<<<<<<<<<<
17365  * return self.from_object
17366  *
17367  */
17368 
17369  /* function exit code */
17370  __pyx_L0:;
17371  __Pyx_XGIVEREF(__pyx_r);
17372  __Pyx_RefNannyFinishContext();
17373  return __pyx_r;
17374 }
17375 
17376 /* "(tree fragment)":1
17377  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17378  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17379  * def __setstate_cython__(self, __pyx_state):
17380  */
17381 
17382 /* Python wrapper */
17383 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17384 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17385  PyObject *__pyx_r = 0;
17386  __Pyx_RefNannyDeclarations
17387  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17388  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17389 
17390  /* function exit code */
17391  __Pyx_RefNannyFinishContext();
17392  return __pyx_r;
17393 }
17394 
17395 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17396  PyObject *__pyx_r = NULL;
17397  __Pyx_RefNannyDeclarations
17398  PyObject *__pyx_t_1 = NULL;
17399  int __pyx_lineno = 0;
17400  const char *__pyx_filename = NULL;
17401  int __pyx_clineno = 0;
17402  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17403 
17404  /* "(tree fragment)":2
17405  * def __reduce_cython__(self):
17406  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17407  * def __setstate_cython__(self, __pyx_state):
17408  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17409  */
17410  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17411  __Pyx_GOTREF(__pyx_t_1);
17412  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17413  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17414  __PYX_ERR(1, 2, __pyx_L1_error)
17415 
17416  /* "(tree fragment)":1
17417  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17418  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17419  * def __setstate_cython__(self, __pyx_state):
17420  */
17421 
17422  /* function exit code */
17423  __pyx_L1_error:;
17424  __Pyx_XDECREF(__pyx_t_1);
17425  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17426  __pyx_r = NULL;
17427  __Pyx_XGIVEREF(__pyx_r);
17428  __Pyx_RefNannyFinishContext();
17429  return __pyx_r;
17430 }
17431 
17432 /* "(tree fragment)":3
17433  * def __reduce_cython__(self):
17434  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17435  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17436  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17437  */
17438 
17439 /* Python wrapper */
17440 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17441 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17442  PyObject *__pyx_r = 0;
17443  __Pyx_RefNannyDeclarations
17444  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17445  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17446 
17447  /* function exit code */
17448  __Pyx_RefNannyFinishContext();
17449  return __pyx_r;
17450 }
17451 
17452 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17453  PyObject *__pyx_r = NULL;
17454  __Pyx_RefNannyDeclarations
17455  PyObject *__pyx_t_1 = NULL;
17456  int __pyx_lineno = 0;
17457  const char *__pyx_filename = NULL;
17458  int __pyx_clineno = 0;
17459  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17460 
17461  /* "(tree fragment)":4
17462  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17463  * def __setstate_cython__(self, __pyx_state):
17464  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17465  */
17466  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17467  __Pyx_GOTREF(__pyx_t_1);
17468  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17469  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17470  __PYX_ERR(1, 4, __pyx_L1_error)
17471 
17472  /* "(tree fragment)":3
17473  * def __reduce_cython__(self):
17474  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17475  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17476  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17477  */
17478 
17479  /* function exit code */
17480  __pyx_L1_error:;
17481  __Pyx_XDECREF(__pyx_t_1);
17482  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17483  __pyx_r = NULL;
17484  __Pyx_XGIVEREF(__pyx_r);
17485  __Pyx_RefNannyFinishContext();
17486  return __pyx_r;
17487 }
17488 
17489 /* "View.MemoryView":999
17490  *
17491  * @cname('__pyx_memoryview_fromslice')
17492  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17493  * int ndim,
17494  * object (*to_object_func)(char *),
17495  */
17496 
17497 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17498  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17499  Py_ssize_t __pyx_v_suboffset;
17500  PyObject *__pyx_v_length = NULL;
17501  PyObject *__pyx_r = NULL;
17502  __Pyx_RefNannyDeclarations
17503  int __pyx_t_1;
17504  PyObject *__pyx_t_2 = NULL;
17505  PyObject *__pyx_t_3 = NULL;
17506  __Pyx_TypeInfo *__pyx_t_4;
17507  Py_buffer __pyx_t_5;
17508  Py_ssize_t *__pyx_t_6;
17509  Py_ssize_t *__pyx_t_7;
17510  Py_ssize_t *__pyx_t_8;
17511  Py_ssize_t __pyx_t_9;
17512  int __pyx_lineno = 0;
17513  const char *__pyx_filename = NULL;
17514  int __pyx_clineno = 0;
17515  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17516 
17517  /* "View.MemoryView":1007
17518  * cdef _memoryviewslice result
17519  *
17520  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17521  * return None
17522  *
17523  */
17524  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17525  if (__pyx_t_1) {
17526 
17527  /* "View.MemoryView":1008
17528  *
17529  * if <PyObject *> memviewslice.memview == Py_None:
17530  * return None # <<<<<<<<<<<<<<
17531  *
17532  *
17533  */
17534  __Pyx_XDECREF(__pyx_r);
17535  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17536  goto __pyx_L0;
17537 
17538  /* "View.MemoryView":1007
17539  * cdef _memoryviewslice result
17540  *
17541  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17542  * return None
17543  *
17544  */
17545  }
17546 
17547  /* "View.MemoryView":1013
17548  *
17549  *
17550  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17551  *
17552  * result.from_slice = memviewslice
17553  */
17554  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17555  __Pyx_GOTREF(__pyx_t_2);
17556  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17557  __Pyx_GOTREF(__pyx_t_3);
17558  __Pyx_INCREF(Py_None);
17559  __Pyx_GIVEREF(Py_None);
17560  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17561  __Pyx_INCREF(__pyx_int_0);
17562  __Pyx_GIVEREF(__pyx_int_0);
17563  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17564  __Pyx_GIVEREF(__pyx_t_2);
17565  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17566  __pyx_t_2 = 0;
17567  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17568  __Pyx_GOTREF(__pyx_t_2);
17569  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17570  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17571  __pyx_t_2 = 0;
17572 
17573  /* "View.MemoryView":1015
17574  * result = _memoryviewslice(None, 0, dtype_is_object)
17575  *
17576  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17577  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17578  *
17579  */
17580  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17581 
17582  /* "View.MemoryView":1016
17583  *
17584  * result.from_slice = memviewslice
17585  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17586  *
17587  * result.from_object = (<memoryview> memviewslice.memview).base
17588  */
17589  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17590 
17591  /* "View.MemoryView":1018
17592  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17593  *
17594  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17595  * result.typeinfo = memviewslice.memview.typeinfo
17596  *
17597  */
17598  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17599  __Pyx_GOTREF(__pyx_t_2);
17600  __Pyx_GIVEREF(__pyx_t_2);
17601  __Pyx_GOTREF(__pyx_v_result->from_object);
17602  __Pyx_DECREF(__pyx_v_result->from_object);
17603  __pyx_v_result->from_object = __pyx_t_2;
17604  __pyx_t_2 = 0;
17605 
17606  /* "View.MemoryView":1019
17607  *
17608  * result.from_object = (<memoryview> memviewslice.memview).base
17609  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17610  *
17611  * result.view = memviewslice.memview.view
17612  */
17613  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17614  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17615 
17616  /* "View.MemoryView":1021
17617  * result.typeinfo = memviewslice.memview.typeinfo
17618  *
17619  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17620  * result.view.buf = <void *> memviewslice.data
17621  * result.view.ndim = ndim
17622  */
17623  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17624  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17625 
17626  /* "View.MemoryView":1022
17627  *
17628  * result.view = memviewslice.memview.view
17629  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17630  * result.view.ndim = ndim
17631  * (<__pyx_buffer *> &result.view).obj = Py_None
17632  */
17633  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17634 
17635  /* "View.MemoryView":1023
17636  * result.view = memviewslice.memview.view
17637  * result.view.buf = <void *> memviewslice.data
17638  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17639  * (<__pyx_buffer *> &result.view).obj = Py_None
17640  * Py_INCREF(Py_None)
17641  */
17642  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17643 
17644  /* "View.MemoryView":1024
17645  * result.view.buf = <void *> memviewslice.data
17646  * result.view.ndim = ndim
17647  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17648  * Py_INCREF(Py_None)
17649  *
17650  */
17651  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17652 
17653  /* "View.MemoryView":1025
17654  * result.view.ndim = ndim
17655  * (<__pyx_buffer *> &result.view).obj = Py_None
17656  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17657  *
17658  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17659  */
17660  Py_INCREF(Py_None);
17661 
17662  /* "View.MemoryView":1027
17663  * Py_INCREF(Py_None)
17664  *
17665  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17666  * result.flags = PyBUF_RECORDS
17667  * else:
17668  */
17669  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17670  if (__pyx_t_1) {
17671 
17672  /* "View.MemoryView":1028
17673  *
17674  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17675  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17676  * else:
17677  * result.flags = PyBUF_RECORDS_RO
17678  */
17679  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17680 
17681  /* "View.MemoryView":1027
17682  * Py_INCREF(Py_None)
17683  *
17684  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17685  * result.flags = PyBUF_RECORDS
17686  * else:
17687  */
17688  goto __pyx_L4;
17689  }
17690 
17691  /* "View.MemoryView":1030
17692  * result.flags = PyBUF_RECORDS
17693  * else:
17694  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17695  *
17696  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17697  */
17698  /*else*/ {
17699  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17700  }
17701  __pyx_L4:;
17702 
17703  /* "View.MemoryView":1032
17704  * result.flags = PyBUF_RECORDS_RO
17705  *
17706  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17707  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17708  *
17709  */
17710  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17711 
17712  /* "View.MemoryView":1033
17713  *
17714  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17715  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17716  *
17717  *
17718  */
17719  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17720 
17721  /* "View.MemoryView":1036
17722  *
17723  *
17724  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17725  * for suboffset in result.from_slice.suboffsets[:ndim]:
17726  * if suboffset >= 0:
17727  */
17728  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17729 
17730  /* "View.MemoryView":1037
17731  *
17732  * result.view.suboffsets = NULL
17733  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17734  * if suboffset >= 0:
17735  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17736  */
17737  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17738  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17739  __pyx_t_6 = __pyx_t_8;
17740  __pyx_v_suboffset = (__pyx_t_6[0]);
17741 
17742  /* "View.MemoryView":1038
17743  * result.view.suboffsets = NULL
17744  * for suboffset in result.from_slice.suboffsets[:ndim]:
17745  * if suboffset >= 0: # <<<<<<<<<<<<<<
17746  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17747  * break
17748  */
17749  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17750  if (__pyx_t_1) {
17751 
17752  /* "View.MemoryView":1039
17753  * for suboffset in result.from_slice.suboffsets[:ndim]:
17754  * if suboffset >= 0:
17755  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17756  * break
17757  *
17758  */
17759  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17760 
17761  /* "View.MemoryView":1040
17762  * if suboffset >= 0:
17763  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17764  * break # <<<<<<<<<<<<<<
17765  *
17766  * result.view.len = result.view.itemsize
17767  */
17768  goto __pyx_L6_break;
17769 
17770  /* "View.MemoryView":1038
17771  * result.view.suboffsets = NULL
17772  * for suboffset in result.from_slice.suboffsets[:ndim]:
17773  * if suboffset >= 0: # <<<<<<<<<<<<<<
17774  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17775  * break
17776  */
17777  }
17778  }
17779  __pyx_L6_break:;
17780 
17781  /* "View.MemoryView":1042
17782  * break
17783  *
17784  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17785  * for length in result.view.shape[:ndim]:
17786  * result.view.len *= length
17787  */
17788  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17789  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17790 
17791  /* "View.MemoryView":1043
17792  *
17793  * result.view.len = result.view.itemsize
17794  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17795  * result.view.len *= length
17796  *
17797  */
17798  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17799  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17800  __pyx_t_6 = __pyx_t_8;
17801  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17802  __Pyx_GOTREF(__pyx_t_2);
17803  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17804  __pyx_t_2 = 0;
17805 
17806  /* "View.MemoryView":1044
17807  * result.view.len = result.view.itemsize
17808  * for length in result.view.shape[:ndim]:
17809  * result.view.len *= length # <<<<<<<<<<<<<<
17810  *
17811  * result.to_object_func = to_object_func
17812  */
17813  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17814  __Pyx_GOTREF(__pyx_t_2);
17815  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17816  __Pyx_GOTREF(__pyx_t_3);
17817  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17818  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17819  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17820  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17821  }
17822 
17823  /* "View.MemoryView":1046
17824  * result.view.len *= length
17825  *
17826  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17827  * result.to_dtype_func = to_dtype_func
17828  *
17829  */
17830  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17831 
17832  /* "View.MemoryView":1047
17833  *
17834  * result.to_object_func = to_object_func
17835  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17836  *
17837  * return result
17838  */
17839  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17840 
17841  /* "View.MemoryView":1049
17842  * result.to_dtype_func = to_dtype_func
17843  *
17844  * return result # <<<<<<<<<<<<<<
17845  *
17846  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17847  */
17848  __Pyx_XDECREF(__pyx_r);
17849  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17850  __pyx_r = ((PyObject *)__pyx_v_result);
17851  goto __pyx_L0;
17852 
17853  /* "View.MemoryView":999
17854  *
17855  * @cname('__pyx_memoryview_fromslice')
17856  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17857  * int ndim,
17858  * object (*to_object_func)(char *),
17859  */
17860 
17861  /* function exit code */
17862  __pyx_L1_error:;
17863  __Pyx_XDECREF(__pyx_t_2);
17864  __Pyx_XDECREF(__pyx_t_3);
17865  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17866  __pyx_r = 0;
17867  __pyx_L0:;
17868  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17869  __Pyx_XDECREF(__pyx_v_length);
17870  __Pyx_XGIVEREF(__pyx_r);
17871  __Pyx_RefNannyFinishContext();
17872  return __pyx_r;
17873 }
17874 
17875 /* "View.MemoryView":1052
17876  *
17877  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17878  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17879  * __Pyx_memviewslice *mslice) except NULL:
17880  * cdef _memoryviewslice obj
17881  */
17882 
17883 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17884  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17885  __Pyx_memviewslice *__pyx_r;
17886  __Pyx_RefNannyDeclarations
17887  int __pyx_t_1;
17888  int __pyx_t_2;
17889  PyObject *__pyx_t_3 = NULL;
17890  int __pyx_lineno = 0;
17891  const char *__pyx_filename = NULL;
17892  int __pyx_clineno = 0;
17893  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17894 
17895  /* "View.MemoryView":1055
17896  * __Pyx_memviewslice *mslice) except NULL:
17897  * cdef _memoryviewslice obj
17898  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17899  * obj = memview
17900  * return &obj.from_slice
17901  */
17902  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17903  __pyx_t_2 = (__pyx_t_1 != 0);
17904  if (__pyx_t_2) {
17905 
17906  /* "View.MemoryView":1056
17907  * cdef _memoryviewslice obj
17908  * if isinstance(memview, _memoryviewslice):
17909  * obj = memview # <<<<<<<<<<<<<<
17910  * return &obj.from_slice
17911  * else:
17912  */
17913  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17914  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17915  __Pyx_INCREF(__pyx_t_3);
17916  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17917  __pyx_t_3 = 0;
17918 
17919  /* "View.MemoryView":1057
17920  * if isinstance(memview, _memoryviewslice):
17921  * obj = memview
17922  * return &obj.from_slice # <<<<<<<<<<<<<<
17923  * else:
17924  * slice_copy(memview, mslice)
17925  */
17926  __pyx_r = (&__pyx_v_obj->from_slice);
17927  goto __pyx_L0;
17928 
17929  /* "View.MemoryView":1055
17930  * __Pyx_memviewslice *mslice) except NULL:
17931  * cdef _memoryviewslice obj
17932  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17933  * obj = memview
17934  * return &obj.from_slice
17935  */
17936  }
17937 
17938  /* "View.MemoryView":1059
17939  * return &obj.from_slice
17940  * else:
17941  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17942  * return mslice
17943  *
17944  */
17945  /*else*/ {
17946  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17947 
17948  /* "View.MemoryView":1060
17949  * else:
17950  * slice_copy(memview, mslice)
17951  * return mslice # <<<<<<<<<<<<<<
17952  *
17953  * @cname('__pyx_memoryview_slice_copy')
17954  */
17955  __pyx_r = __pyx_v_mslice;
17956  goto __pyx_L0;
17957  }
17958 
17959  /* "View.MemoryView":1052
17960  *
17961  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17962  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17963  * __Pyx_memviewslice *mslice) except NULL:
17964  * cdef _memoryviewslice obj
17965  */
17966 
17967  /* function exit code */
17968  __pyx_L1_error:;
17969  __Pyx_XDECREF(__pyx_t_3);
17970  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17971  __pyx_r = NULL;
17972  __pyx_L0:;
17973  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17974  __Pyx_RefNannyFinishContext();
17975  return __pyx_r;
17976 }
17977 
17978 /* "View.MemoryView":1063
17979  *
17980  * @cname('__pyx_memoryview_slice_copy')
17981  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17982  * cdef int dim
17983  * cdef (Py_ssize_t*) shape, strides, suboffsets
17984  */
17985 
17986 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17987  int __pyx_v_dim;
17988  Py_ssize_t *__pyx_v_shape;
17989  Py_ssize_t *__pyx_v_strides;
17990  Py_ssize_t *__pyx_v_suboffsets;
17991  __Pyx_RefNannyDeclarations
17992  Py_ssize_t *__pyx_t_1;
17993  int __pyx_t_2;
17994  int __pyx_t_3;
17995  int __pyx_t_4;
17996  Py_ssize_t __pyx_t_5;
17997  __Pyx_RefNannySetupContext("slice_copy", 0);
17998 
17999  /* "View.MemoryView":1067
18000  * cdef (Py_ssize_t*) shape, strides, suboffsets
18001  *
18002  * shape = memview.view.shape # <<<<<<<<<<<<<<
18003  * strides = memview.view.strides
18004  * suboffsets = memview.view.suboffsets
18005  */
18006  __pyx_t_1 = __pyx_v_memview->view.shape;
18007  __pyx_v_shape = __pyx_t_1;
18008 
18009  /* "View.MemoryView":1068
18010  *
18011  * shape = memview.view.shape
18012  * strides = memview.view.strides # <<<<<<<<<<<<<<
18013  * suboffsets = memview.view.suboffsets
18014  *
18015  */
18016  __pyx_t_1 = __pyx_v_memview->view.strides;
18017  __pyx_v_strides = __pyx_t_1;
18018 
18019  /* "View.MemoryView":1069
18020  * shape = memview.view.shape
18021  * strides = memview.view.strides
18022  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18023  *
18024  * dst.memview = <__pyx_memoryview *> memview
18025  */
18026  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18027  __pyx_v_suboffsets = __pyx_t_1;
18028 
18029  /* "View.MemoryView":1071
18030  * suboffsets = memview.view.suboffsets
18031  *
18032  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18033  * dst.data = <char *> memview.view.buf
18034  *
18035  */
18036  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18037 
18038  /* "View.MemoryView":1072
18039  *
18040  * dst.memview = <__pyx_memoryview *> memview
18041  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18042  *
18043  * for dim in range(memview.view.ndim):
18044  */
18045  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18046 
18047  /* "View.MemoryView":1074
18048  * dst.data = <char *> memview.view.buf
18049  *
18050  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18051  * dst.shape[dim] = shape[dim]
18052  * dst.strides[dim] = strides[dim]
18053  */
18054  __pyx_t_2 = __pyx_v_memview->view.ndim;
18055  __pyx_t_3 = __pyx_t_2;
18056  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18057  __pyx_v_dim = __pyx_t_4;
18058 
18059  /* "View.MemoryView":1075
18060  *
18061  * for dim in range(memview.view.ndim):
18062  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18063  * dst.strides[dim] = strides[dim]
18064  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18065  */
18066  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18067 
18068  /* "View.MemoryView":1076
18069  * for dim in range(memview.view.ndim):
18070  * dst.shape[dim] = shape[dim]
18071  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18072  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18073  *
18074  */
18075  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18076 
18077  /* "View.MemoryView":1077
18078  * dst.shape[dim] = shape[dim]
18079  * dst.strides[dim] = strides[dim]
18080  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18081  *
18082  * @cname('__pyx_memoryview_copy_object')
18083  */
18084  if ((__pyx_v_suboffsets != 0)) {
18085  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18086  } else {
18087  __pyx_t_5 = -1L;
18088  }
18089  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18090  }
18091 
18092  /* "View.MemoryView":1063
18093  *
18094  * @cname('__pyx_memoryview_slice_copy')
18095  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18096  * cdef int dim
18097  * cdef (Py_ssize_t*) shape, strides, suboffsets
18098  */
18099 
18100  /* function exit code */
18101  __Pyx_RefNannyFinishContext();
18102 }
18103 
18104 /* "View.MemoryView":1080
18105  *
18106  * @cname('__pyx_memoryview_copy_object')
18107  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18108  * "Create a new memoryview object"
18109  * cdef __Pyx_memviewslice memviewslice
18110  */
18111 
18112 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18113  __Pyx_memviewslice __pyx_v_memviewslice;
18114  PyObject *__pyx_r = NULL;
18115  __Pyx_RefNannyDeclarations
18116  PyObject *__pyx_t_1 = NULL;
18117  int __pyx_lineno = 0;
18118  const char *__pyx_filename = NULL;
18119  int __pyx_clineno = 0;
18120  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18121 
18122  /* "View.MemoryView":1083
18123  * "Create a new memoryview object"
18124  * cdef __Pyx_memviewslice memviewslice
18125  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18126  * return memoryview_copy_from_slice(memview, &memviewslice)
18127  *
18128  */
18129  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18130 
18131  /* "View.MemoryView":1084
18132  * cdef __Pyx_memviewslice memviewslice
18133  * slice_copy(memview, &memviewslice)
18134  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18135  *
18136  * @cname('__pyx_memoryview_copy_object_from_slice')
18137  */
18138  __Pyx_XDECREF(__pyx_r);
18139  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18140  __Pyx_GOTREF(__pyx_t_1);
18141  __pyx_r = __pyx_t_1;
18142  __pyx_t_1 = 0;
18143  goto __pyx_L0;
18144 
18145  /* "View.MemoryView":1080
18146  *
18147  * @cname('__pyx_memoryview_copy_object')
18148  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18149  * "Create a new memoryview object"
18150  * cdef __Pyx_memviewslice memviewslice
18151  */
18152 
18153  /* function exit code */
18154  __pyx_L1_error:;
18155  __Pyx_XDECREF(__pyx_t_1);
18156  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18157  __pyx_r = 0;
18158  __pyx_L0:;
18159  __Pyx_XGIVEREF(__pyx_r);
18160  __Pyx_RefNannyFinishContext();
18161  return __pyx_r;
18162 }
18163 
18164 /* "View.MemoryView":1087
18165  *
18166  * @cname('__pyx_memoryview_copy_object_from_slice')
18167  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18168  * """
18169  * Create a new memoryview object from a given memoryview object and slice.
18170  */
18171 
18172 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18173  PyObject *(*__pyx_v_to_object_func)(char *);
18174  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18175  PyObject *__pyx_r = NULL;
18176  __Pyx_RefNannyDeclarations
18177  int __pyx_t_1;
18178  int __pyx_t_2;
18179  PyObject *(*__pyx_t_3)(char *);
18180  int (*__pyx_t_4)(char *, PyObject *);
18181  PyObject *__pyx_t_5 = NULL;
18182  int __pyx_lineno = 0;
18183  const char *__pyx_filename = NULL;
18184  int __pyx_clineno = 0;
18185  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18186 
18187  /* "View.MemoryView":1094
18188  * cdef int (*to_dtype_func)(char *, object) except 0
18189  *
18190  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18191  * to_object_func = (<_memoryviewslice> memview).to_object_func
18192  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18193  */
18194  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18195  __pyx_t_2 = (__pyx_t_1 != 0);
18196  if (__pyx_t_2) {
18197 
18198  /* "View.MemoryView":1095
18199  *
18200  * if isinstance(memview, _memoryviewslice):
18201  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18202  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18203  * else:
18204  */
18205  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18206  __pyx_v_to_object_func = __pyx_t_3;
18207 
18208  /* "View.MemoryView":1096
18209  * if isinstance(memview, _memoryviewslice):
18210  * to_object_func = (<_memoryviewslice> memview).to_object_func
18211  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18212  * else:
18213  * to_object_func = NULL
18214  */
18215  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18216  __pyx_v_to_dtype_func = __pyx_t_4;
18217 
18218  /* "View.MemoryView":1094
18219  * cdef int (*to_dtype_func)(char *, object) except 0
18220  *
18221  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18222  * to_object_func = (<_memoryviewslice> memview).to_object_func
18223  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18224  */
18225  goto __pyx_L3;
18226  }
18227 
18228  /* "View.MemoryView":1098
18229  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18230  * else:
18231  * to_object_func = NULL # <<<<<<<<<<<<<<
18232  * to_dtype_func = NULL
18233  *
18234  */
18235  /*else*/ {
18236  __pyx_v_to_object_func = NULL;
18237 
18238  /* "View.MemoryView":1099
18239  * else:
18240  * to_object_func = NULL
18241  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18242  *
18243  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18244  */
18245  __pyx_v_to_dtype_func = NULL;
18246  }
18247  __pyx_L3:;
18248 
18249  /* "View.MemoryView":1101
18250  * to_dtype_func = NULL
18251  *
18252  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18253  * to_object_func, to_dtype_func,
18254  * memview.dtype_is_object)
18255  */
18256  __Pyx_XDECREF(__pyx_r);
18257 
18258  /* "View.MemoryView":1103
18259  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18260  * to_object_func, to_dtype_func,
18261  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18262  *
18263  *
18264  */
18265  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18266  __Pyx_GOTREF(__pyx_t_5);
18267  __pyx_r = __pyx_t_5;
18268  __pyx_t_5 = 0;
18269  goto __pyx_L0;
18270 
18271  /* "View.MemoryView":1087
18272  *
18273  * @cname('__pyx_memoryview_copy_object_from_slice')
18274  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18275  * """
18276  * Create a new memoryview object from a given memoryview object and slice.
18277  */
18278 
18279  /* function exit code */
18280  __pyx_L1_error:;
18281  __Pyx_XDECREF(__pyx_t_5);
18282  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18283  __pyx_r = 0;
18284  __pyx_L0:;
18285  __Pyx_XGIVEREF(__pyx_r);
18286  __Pyx_RefNannyFinishContext();
18287  return __pyx_r;
18288 }
18289 
18290 /* "View.MemoryView":1109
18291  *
18292  *
18293  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18294  * if arg < 0:
18295  * return -arg
18296  */
18297 
18298 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18299  Py_ssize_t __pyx_r;
18300  int __pyx_t_1;
18301 
18302  /* "View.MemoryView":1110
18303  *
18304  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18305  * if arg < 0: # <<<<<<<<<<<<<<
18306  * return -arg
18307  * else:
18308  */
18309  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18310  if (__pyx_t_1) {
18311 
18312  /* "View.MemoryView":1111
18313  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18314  * if arg < 0:
18315  * return -arg # <<<<<<<<<<<<<<
18316  * else:
18317  * return arg
18318  */
18319  __pyx_r = (-__pyx_v_arg);
18320  goto __pyx_L0;
18321 
18322  /* "View.MemoryView":1110
18323  *
18324  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18325  * if arg < 0: # <<<<<<<<<<<<<<
18326  * return -arg
18327  * else:
18328  */
18329  }
18330 
18331  /* "View.MemoryView":1113
18332  * return -arg
18333  * else:
18334  * return arg # <<<<<<<<<<<<<<
18335  *
18336  * @cname('__pyx_get_best_slice_order')
18337  */
18338  /*else*/ {
18339  __pyx_r = __pyx_v_arg;
18340  goto __pyx_L0;
18341  }
18342 
18343  /* "View.MemoryView":1109
18344  *
18345  *
18346  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18347  * if arg < 0:
18348  * return -arg
18349  */
18350 
18351  /* function exit code */
18352  __pyx_L0:;
18353  return __pyx_r;
18354 }
18355 
18356 /* "View.MemoryView":1116
18357  *
18358  * @cname('__pyx_get_best_slice_order')
18359  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18360  * """
18361  * Figure out the best memory access order for a given slice.
18362  */
18363 
18364 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18365  int __pyx_v_i;
18366  Py_ssize_t __pyx_v_c_stride;
18367  Py_ssize_t __pyx_v_f_stride;
18368  char __pyx_r;
18369  int __pyx_t_1;
18370  int __pyx_t_2;
18371  int __pyx_t_3;
18372  int __pyx_t_4;
18373 
18374  /* "View.MemoryView":1121
18375  * """
18376  * cdef int i
18377  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18378  * cdef Py_ssize_t f_stride = 0
18379  *
18380  */
18381  __pyx_v_c_stride = 0;
18382 
18383  /* "View.MemoryView":1122
18384  * cdef int i
18385  * cdef Py_ssize_t c_stride = 0
18386  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18387  *
18388  * for i in range(ndim - 1, -1, -1):
18389  */
18390  __pyx_v_f_stride = 0;
18391 
18392  /* "View.MemoryView":1124
18393  * cdef Py_ssize_t f_stride = 0
18394  *
18395  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18396  * if mslice.shape[i] > 1:
18397  * c_stride = mslice.strides[i]
18398  */
18399  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18400  __pyx_v_i = __pyx_t_1;
18401 
18402  /* "View.MemoryView":1125
18403  *
18404  * for i in range(ndim - 1, -1, -1):
18405  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18406  * c_stride = mslice.strides[i]
18407  * break
18408  */
18409  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18410  if (__pyx_t_2) {
18411 
18412  /* "View.MemoryView":1126
18413  * for i in range(ndim - 1, -1, -1):
18414  * if mslice.shape[i] > 1:
18415  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18416  * break
18417  *
18418  */
18419  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18420 
18421  /* "View.MemoryView":1127
18422  * if mslice.shape[i] > 1:
18423  * c_stride = mslice.strides[i]
18424  * break # <<<<<<<<<<<<<<
18425  *
18426  * for i in range(ndim):
18427  */
18428  goto __pyx_L4_break;
18429 
18430  /* "View.MemoryView":1125
18431  *
18432  * for i in range(ndim - 1, -1, -1):
18433  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18434  * c_stride = mslice.strides[i]
18435  * break
18436  */
18437  }
18438  }
18439  __pyx_L4_break:;
18440 
18441  /* "View.MemoryView":1129
18442  * break
18443  *
18444  * for i in range(ndim): # <<<<<<<<<<<<<<
18445  * if mslice.shape[i] > 1:
18446  * f_stride = mslice.strides[i]
18447  */
18448  __pyx_t_1 = __pyx_v_ndim;
18449  __pyx_t_3 = __pyx_t_1;
18450  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18451  __pyx_v_i = __pyx_t_4;
18452 
18453  /* "View.MemoryView":1130
18454  *
18455  * for i in range(ndim):
18456  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18457  * f_stride = mslice.strides[i]
18458  * break
18459  */
18460  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18461  if (__pyx_t_2) {
18462 
18463  /* "View.MemoryView":1131
18464  * for i in range(ndim):
18465  * if mslice.shape[i] > 1:
18466  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18467  * break
18468  *
18469  */
18470  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18471 
18472  /* "View.MemoryView":1132
18473  * if mslice.shape[i] > 1:
18474  * f_stride = mslice.strides[i]
18475  * break # <<<<<<<<<<<<<<
18476  *
18477  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18478  */
18479  goto __pyx_L7_break;
18480 
18481  /* "View.MemoryView":1130
18482  *
18483  * for i in range(ndim):
18484  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18485  * f_stride = mslice.strides[i]
18486  * break
18487  */
18488  }
18489  }
18490  __pyx_L7_break:;
18491 
18492  /* "View.MemoryView":1134
18493  * break
18494  *
18495  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18496  * return 'C'
18497  * else:
18498  */
18499  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18500  if (__pyx_t_2) {
18501 
18502  /* "View.MemoryView":1135
18503  *
18504  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18505  * return 'C' # <<<<<<<<<<<<<<
18506  * else:
18507  * return 'F'
18508  */
18509  __pyx_r = 'C';
18510  goto __pyx_L0;
18511 
18512  /* "View.MemoryView":1134
18513  * break
18514  *
18515  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18516  * return 'C'
18517  * else:
18518  */
18519  }
18520 
18521  /* "View.MemoryView":1137
18522  * return 'C'
18523  * else:
18524  * return 'F' # <<<<<<<<<<<<<<
18525  *
18526  * @cython.cdivision(True)
18527  */
18528  /*else*/ {
18529  __pyx_r = 'F';
18530  goto __pyx_L0;
18531  }
18532 
18533  /* "View.MemoryView":1116
18534  *
18535  * @cname('__pyx_get_best_slice_order')
18536  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18537  * """
18538  * Figure out the best memory access order for a given slice.
18539  */
18540 
18541  /* function exit code */
18542  __pyx_L0:;
18543  return __pyx_r;
18544 }
18545 
18546 /* "View.MemoryView":1140
18547  *
18548  * @cython.cdivision(True)
18549  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18550  * char *dst_data, Py_ssize_t *dst_strides,
18551  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18552  */
18553 
18554 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18555  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18556  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18557  Py_ssize_t __pyx_v_dst_extent;
18558  Py_ssize_t __pyx_v_src_stride;
18559  Py_ssize_t __pyx_v_dst_stride;
18560  int __pyx_t_1;
18561  int __pyx_t_2;
18562  int __pyx_t_3;
18563  Py_ssize_t __pyx_t_4;
18564  Py_ssize_t __pyx_t_5;
18565  Py_ssize_t __pyx_t_6;
18566 
18567  /* "View.MemoryView":1147
18568  *
18569  * cdef Py_ssize_t i
18570  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18571  * cdef Py_ssize_t dst_extent = dst_shape[0]
18572  * cdef Py_ssize_t src_stride = src_strides[0]
18573  */
18574  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18575 
18576  /* "View.MemoryView":1148
18577  * cdef Py_ssize_t i
18578  * cdef Py_ssize_t src_extent = src_shape[0]
18579  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18580  * cdef Py_ssize_t src_stride = src_strides[0]
18581  * cdef Py_ssize_t dst_stride = dst_strides[0]
18582  */
18583  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18584 
18585  /* "View.MemoryView":1149
18586  * cdef Py_ssize_t src_extent = src_shape[0]
18587  * cdef Py_ssize_t dst_extent = dst_shape[0]
18588  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18589  * cdef Py_ssize_t dst_stride = dst_strides[0]
18590  *
18591  */
18592  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18593 
18594  /* "View.MemoryView":1150
18595  * cdef Py_ssize_t dst_extent = dst_shape[0]
18596  * cdef Py_ssize_t src_stride = src_strides[0]
18597  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18598  *
18599  * if ndim == 1:
18600  */
18601  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18602 
18603  /* "View.MemoryView":1152
18604  * cdef Py_ssize_t dst_stride = dst_strides[0]
18605  *
18606  * if ndim == 1: # <<<<<<<<<<<<<<
18607  * if (src_stride > 0 and dst_stride > 0 and
18608  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18609  */
18610  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18611  if (__pyx_t_1) {
18612 
18613  /* "View.MemoryView":1153
18614  *
18615  * if ndim == 1:
18616  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18617  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18618  * memcpy(dst_data, src_data, itemsize * dst_extent)
18619  */
18620  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18621  if (__pyx_t_2) {
18622  } else {
18623  __pyx_t_1 = __pyx_t_2;
18624  goto __pyx_L5_bool_binop_done;
18625  }
18626  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18627  if (__pyx_t_2) {
18628  } else {
18629  __pyx_t_1 = __pyx_t_2;
18630  goto __pyx_L5_bool_binop_done;
18631  }
18632 
18633  /* "View.MemoryView":1154
18634  * if ndim == 1:
18635  * if (src_stride > 0 and dst_stride > 0 and
18636  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18637  * memcpy(dst_data, src_data, itemsize * dst_extent)
18638  * else:
18639  */
18640  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18641  if (__pyx_t_2) {
18642  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18643  }
18644  __pyx_t_3 = (__pyx_t_2 != 0);
18645  __pyx_t_1 = __pyx_t_3;
18646  __pyx_L5_bool_binop_done:;
18647 
18648  /* "View.MemoryView":1153
18649  *
18650  * if ndim == 1:
18651  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18652  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18653  * memcpy(dst_data, src_data, itemsize * dst_extent)
18654  */
18655  if (__pyx_t_1) {
18656 
18657  /* "View.MemoryView":1155
18658  * if (src_stride > 0 and dst_stride > 0 and
18659  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18660  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18661  * else:
18662  * for i in range(dst_extent):
18663  */
18664  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18665 
18666  /* "View.MemoryView":1153
18667  *
18668  * if ndim == 1:
18669  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18670  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18671  * memcpy(dst_data, src_data, itemsize * dst_extent)
18672  */
18673  goto __pyx_L4;
18674  }
18675 
18676  /* "View.MemoryView":1157
18677  * memcpy(dst_data, src_data, itemsize * dst_extent)
18678  * else:
18679  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18680  * memcpy(dst_data, src_data, itemsize)
18681  * src_data += src_stride
18682  */
18683  /*else*/ {
18684  __pyx_t_4 = __pyx_v_dst_extent;
18685  __pyx_t_5 = __pyx_t_4;
18686  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18687  __pyx_v_i = __pyx_t_6;
18688 
18689  /* "View.MemoryView":1158
18690  * else:
18691  * for i in range(dst_extent):
18692  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18693  * src_data += src_stride
18694  * dst_data += dst_stride
18695  */
18696  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18697 
18698  /* "View.MemoryView":1159
18699  * for i in range(dst_extent):
18700  * memcpy(dst_data, src_data, itemsize)
18701  * src_data += src_stride # <<<<<<<<<<<<<<
18702  * dst_data += dst_stride
18703  * else:
18704  */
18705  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18706 
18707  /* "View.MemoryView":1160
18708  * memcpy(dst_data, src_data, itemsize)
18709  * src_data += src_stride
18710  * dst_data += dst_stride # <<<<<<<<<<<<<<
18711  * else:
18712  * for i in range(dst_extent):
18713  */
18714  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18715  }
18716  }
18717  __pyx_L4:;
18718 
18719  /* "View.MemoryView":1152
18720  * cdef Py_ssize_t dst_stride = dst_strides[0]
18721  *
18722  * if ndim == 1: # <<<<<<<<<<<<<<
18723  * if (src_stride > 0 and dst_stride > 0 and
18724  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18725  */
18726  goto __pyx_L3;
18727  }
18728 
18729  /* "View.MemoryView":1162
18730  * dst_data += dst_stride
18731  * else:
18732  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18733  * _copy_strided_to_strided(src_data, src_strides + 1,
18734  * dst_data, dst_strides + 1,
18735  */
18736  /*else*/ {
18737  __pyx_t_4 = __pyx_v_dst_extent;
18738  __pyx_t_5 = __pyx_t_4;
18739  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18740  __pyx_v_i = __pyx_t_6;
18741 
18742  /* "View.MemoryView":1163
18743  * else:
18744  * for i in range(dst_extent):
18745  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18746  * dst_data, dst_strides + 1,
18747  * src_shape + 1, dst_shape + 1,
18748  */
18749  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18750 
18751  /* "View.MemoryView":1167
18752  * src_shape + 1, dst_shape + 1,
18753  * ndim - 1, itemsize)
18754  * src_data += src_stride # <<<<<<<<<<<<<<
18755  * dst_data += dst_stride
18756  *
18757  */
18758  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18759 
18760  /* "View.MemoryView":1168
18761  * ndim - 1, itemsize)
18762  * src_data += src_stride
18763  * dst_data += dst_stride # <<<<<<<<<<<<<<
18764  *
18765  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18766  */
18767  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18768  }
18769  }
18770  __pyx_L3:;
18771 
18772  /* "View.MemoryView":1140
18773  *
18774  * @cython.cdivision(True)
18775  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18776  * char *dst_data, Py_ssize_t *dst_strides,
18777  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18778  */
18779 
18780  /* function exit code */
18781 }
18782 
18783 /* "View.MemoryView":1170
18784  * dst_data += dst_stride
18785  *
18786  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18787  * __Pyx_memviewslice *dst,
18788  * int ndim, size_t itemsize) nogil:
18789  */
18790 
18791 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18792 
18793  /* "View.MemoryView":1173
18794  * __Pyx_memviewslice *dst,
18795  * int ndim, size_t itemsize) nogil:
18796  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18797  * src.shape, dst.shape, ndim, itemsize)
18798  *
18799  */
18800  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18801 
18802  /* "View.MemoryView":1170
18803  * dst_data += dst_stride
18804  *
18805  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18806  * __Pyx_memviewslice *dst,
18807  * int ndim, size_t itemsize) nogil:
18808  */
18809 
18810  /* function exit code */
18811 }
18812 
18813 /* "View.MemoryView":1177
18814  *
18815  * @cname('__pyx_memoryview_slice_get_size')
18816  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18817  * "Return the size of the memory occupied by the slice in number of bytes"
18818  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18819  */
18820 
18821 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18822  Py_ssize_t __pyx_v_shape;
18823  Py_ssize_t __pyx_v_size;
18824  Py_ssize_t __pyx_r;
18825  Py_ssize_t __pyx_t_1;
18826  Py_ssize_t *__pyx_t_2;
18827  Py_ssize_t *__pyx_t_3;
18828  Py_ssize_t *__pyx_t_4;
18829 
18830  /* "View.MemoryView":1179
18831  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18832  * "Return the size of the memory occupied by the slice in number of bytes"
18833  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18834  *
18835  * for shape in src.shape[:ndim]:
18836  */
18837  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18838  __pyx_v_size = __pyx_t_1;
18839 
18840  /* "View.MemoryView":1181
18841  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18842  *
18843  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18844  * size *= shape
18845  *
18846  */
18847  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18848  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18849  __pyx_t_2 = __pyx_t_4;
18850  __pyx_v_shape = (__pyx_t_2[0]);
18851 
18852  /* "View.MemoryView":1182
18853  *
18854  * for shape in src.shape[:ndim]:
18855  * size *= shape # <<<<<<<<<<<<<<
18856  *
18857  * return size
18858  */
18859  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18860  }
18861 
18862  /* "View.MemoryView":1184
18863  * size *= shape
18864  *
18865  * return size # <<<<<<<<<<<<<<
18866  *
18867  * @cname('__pyx_fill_contig_strides_array')
18868  */
18869  __pyx_r = __pyx_v_size;
18870  goto __pyx_L0;
18871 
18872  /* "View.MemoryView":1177
18873  *
18874  * @cname('__pyx_memoryview_slice_get_size')
18875  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18876  * "Return the size of the memory occupied by the slice in number of bytes"
18877  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18878  */
18879 
18880  /* function exit code */
18881  __pyx_L0:;
18882  return __pyx_r;
18883 }
18884 
18885 /* "View.MemoryView":1187
18886  *
18887  * @cname('__pyx_fill_contig_strides_array')
18888  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18889  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18890  * int ndim, char order) nogil:
18891  */
18892 
18893 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18894  int __pyx_v_idx;
18895  Py_ssize_t __pyx_r;
18896  int __pyx_t_1;
18897  int __pyx_t_2;
18898  int __pyx_t_3;
18899  int __pyx_t_4;
18900 
18901  /* "View.MemoryView":1196
18902  * cdef int idx
18903  *
18904  * if order == 'F': # <<<<<<<<<<<<<<
18905  * for idx in range(ndim):
18906  * strides[idx] = stride
18907  */
18908  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18909  if (__pyx_t_1) {
18910 
18911  /* "View.MemoryView":1197
18912  *
18913  * if order == 'F':
18914  * for idx in range(ndim): # <<<<<<<<<<<<<<
18915  * strides[idx] = stride
18916  * stride *= shape[idx]
18917  */
18918  __pyx_t_2 = __pyx_v_ndim;
18919  __pyx_t_3 = __pyx_t_2;
18920  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18921  __pyx_v_idx = __pyx_t_4;
18922 
18923  /* "View.MemoryView":1198
18924  * if order == 'F':
18925  * for idx in range(ndim):
18926  * strides[idx] = stride # <<<<<<<<<<<<<<
18927  * stride *= shape[idx]
18928  * else:
18929  */
18930  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18931 
18932  /* "View.MemoryView":1199
18933  * for idx in range(ndim):
18934  * strides[idx] = stride
18935  * stride *= shape[idx] # <<<<<<<<<<<<<<
18936  * else:
18937  * for idx in range(ndim - 1, -1, -1):
18938  */
18939  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18940  }
18941 
18942  /* "View.MemoryView":1196
18943  * cdef int idx
18944  *
18945  * if order == 'F': # <<<<<<<<<<<<<<
18946  * for idx in range(ndim):
18947  * strides[idx] = stride
18948  */
18949  goto __pyx_L3;
18950  }
18951 
18952  /* "View.MemoryView":1201
18953  * stride *= shape[idx]
18954  * else:
18955  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18956  * strides[idx] = stride
18957  * stride *= shape[idx]
18958  */
18959  /*else*/ {
18960  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18961  __pyx_v_idx = __pyx_t_2;
18962 
18963  /* "View.MemoryView":1202
18964  * else:
18965  * for idx in range(ndim - 1, -1, -1):
18966  * strides[idx] = stride # <<<<<<<<<<<<<<
18967  * stride *= shape[idx]
18968  *
18969  */
18970  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18971 
18972  /* "View.MemoryView":1203
18973  * for idx in range(ndim - 1, -1, -1):
18974  * strides[idx] = stride
18975  * stride *= shape[idx] # <<<<<<<<<<<<<<
18976  *
18977  * return stride
18978  */
18979  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18980  }
18981  }
18982  __pyx_L3:;
18983 
18984  /* "View.MemoryView":1205
18985  * stride *= shape[idx]
18986  *
18987  * return stride # <<<<<<<<<<<<<<
18988  *
18989  * @cname('__pyx_memoryview_copy_data_to_temp')
18990  */
18991  __pyx_r = __pyx_v_stride;
18992  goto __pyx_L0;
18993 
18994  /* "View.MemoryView":1187
18995  *
18996  * @cname('__pyx_fill_contig_strides_array')
18997  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18998  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18999  * int ndim, char order) nogil:
19000  */
19001 
19002  /* function exit code */
19003  __pyx_L0:;
19004  return __pyx_r;
19005 }
19006 
19007 /* "View.MemoryView":1208
19008  *
19009  * @cname('__pyx_memoryview_copy_data_to_temp')
19010  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19011  * __Pyx_memviewslice *tmpslice,
19012  * char order,
19013  */
19014 
19015 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
19016  int __pyx_v_i;
19017  void *__pyx_v_result;
19018  size_t __pyx_v_itemsize;
19019  size_t __pyx_v_size;
19020  void *__pyx_r;
19021  Py_ssize_t __pyx_t_1;
19022  int __pyx_t_2;
19023  int __pyx_t_3;
19024  struct __pyx_memoryview_obj *__pyx_t_4;
19025  int __pyx_t_5;
19026  int __pyx_t_6;
19027  int __pyx_lineno = 0;
19028  const char *__pyx_filename = NULL;
19029  int __pyx_clineno = 0;
19030 
19031  /* "View.MemoryView":1219
19032  * cdef void *result
19033  *
19034  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19035  * cdef size_t size = slice_get_size(src, ndim)
19036  *
19037  */
19038  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19039  __pyx_v_itemsize = __pyx_t_1;
19040 
19041  /* "View.MemoryView":1220
19042  *
19043  * cdef size_t itemsize = src.memview.view.itemsize
19044  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19045  *
19046  * result = malloc(size)
19047  */
19048  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19049 
19050  /* "View.MemoryView":1222
19051  * cdef size_t size = slice_get_size(src, ndim)
19052  *
19053  * result = malloc(size) # <<<<<<<<<<<<<<
19054  * if not result:
19055  * _err(MemoryError, NULL)
19056  */
19057  __pyx_v_result = malloc(__pyx_v_size);
19058 
19059  /* "View.MemoryView":1223
19060  *
19061  * result = malloc(size)
19062  * if not result: # <<<<<<<<<<<<<<
19063  * _err(MemoryError, NULL)
19064  *
19065  */
19066  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19067  if (__pyx_t_2) {
19068 
19069  /* "View.MemoryView":1224
19070  * result = malloc(size)
19071  * if not result:
19072  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19073  *
19074  *
19075  */
19076  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19077 
19078  /* "View.MemoryView":1223
19079  *
19080  * result = malloc(size)
19081  * if not result: # <<<<<<<<<<<<<<
19082  * _err(MemoryError, NULL)
19083  *
19084  */
19085  }
19086 
19087  /* "View.MemoryView":1227
19088  *
19089  *
19090  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19091  * tmpslice.memview = src.memview
19092  * for i in range(ndim):
19093  */
19094  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19095 
19096  /* "View.MemoryView":1228
19097  *
19098  * tmpslice.data = <char *> result
19099  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19100  * for i in range(ndim):
19101  * tmpslice.shape[i] = src.shape[i]
19102  */
19103  __pyx_t_4 = __pyx_v_src->memview;
19104  __pyx_v_tmpslice->memview = __pyx_t_4;
19105 
19106  /* "View.MemoryView":1229
19107  * tmpslice.data = <char *> result
19108  * tmpslice.memview = src.memview
19109  * for i in range(ndim): # <<<<<<<<<<<<<<
19110  * tmpslice.shape[i] = src.shape[i]
19111  * tmpslice.suboffsets[i] = -1
19112  */
19113  __pyx_t_3 = __pyx_v_ndim;
19114  __pyx_t_5 = __pyx_t_3;
19115  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19116  __pyx_v_i = __pyx_t_6;
19117 
19118  /* "View.MemoryView":1230
19119  * tmpslice.memview = src.memview
19120  * for i in range(ndim):
19121  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19122  * tmpslice.suboffsets[i] = -1
19123  *
19124  */
19125  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19126 
19127  /* "View.MemoryView":1231
19128  * for i in range(ndim):
19129  * tmpslice.shape[i] = src.shape[i]
19130  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19131  *
19132  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19133  */
19134  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19135  }
19136 
19137  /* "View.MemoryView":1233
19138  * tmpslice.suboffsets[i] = -1
19139  *
19140  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19141  * ndim, order)
19142  *
19143  */
19144  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19145 
19146  /* "View.MemoryView":1237
19147  *
19148  *
19149  * for i in range(ndim): # <<<<<<<<<<<<<<
19150  * if tmpslice.shape[i] == 1:
19151  * tmpslice.strides[i] = 0
19152  */
19153  __pyx_t_3 = __pyx_v_ndim;
19154  __pyx_t_5 = __pyx_t_3;
19155  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19156  __pyx_v_i = __pyx_t_6;
19157 
19158  /* "View.MemoryView":1238
19159  *
19160  * for i in range(ndim):
19161  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19162  * tmpslice.strides[i] = 0
19163  *
19164  */
19165  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19166  if (__pyx_t_2) {
19167 
19168  /* "View.MemoryView":1239
19169  * for i in range(ndim):
19170  * if tmpslice.shape[i] == 1:
19171  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19172  *
19173  * if slice_is_contig(src[0], order, ndim):
19174  */
19175  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19176 
19177  /* "View.MemoryView":1238
19178  *
19179  * for i in range(ndim):
19180  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19181  * tmpslice.strides[i] = 0
19182  *
19183  */
19184  }
19185  }
19186 
19187  /* "View.MemoryView":1241
19188  * tmpslice.strides[i] = 0
19189  *
19190  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19191  * memcpy(result, src.data, size)
19192  * else:
19193  */
19194  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19195  if (__pyx_t_2) {
19196 
19197  /* "View.MemoryView":1242
19198  *
19199  * if slice_is_contig(src[0], order, ndim):
19200  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19201  * else:
19202  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19203  */
19204  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19205 
19206  /* "View.MemoryView":1241
19207  * tmpslice.strides[i] = 0
19208  *
19209  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19210  * memcpy(result, src.data, size)
19211  * else:
19212  */
19213  goto __pyx_L9;
19214  }
19215 
19216  /* "View.MemoryView":1244
19217  * memcpy(result, src.data, size)
19218  * else:
19219  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19220  *
19221  * return result
19222  */
19223  /*else*/ {
19224  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19225  }
19226  __pyx_L9:;
19227 
19228  /* "View.MemoryView":1246
19229  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19230  *
19231  * return result # <<<<<<<<<<<<<<
19232  *
19233  *
19234  */
19235  __pyx_r = __pyx_v_result;
19236  goto __pyx_L0;
19237 
19238  /* "View.MemoryView":1208
19239  *
19240  * @cname('__pyx_memoryview_copy_data_to_temp')
19241  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19242  * __Pyx_memviewslice *tmpslice,
19243  * char order,
19244  */
19245 
19246  /* function exit code */
19247  __pyx_L1_error:;
19248  {
19249  #ifdef WITH_THREAD
19250  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19251  #endif
19252  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19253  #ifdef WITH_THREAD
19254  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19255  #endif
19256  }
19257  __pyx_r = NULL;
19258  __pyx_L0:;
19259  return __pyx_r;
19260 }
19261 
19262 /* "View.MemoryView":1251
19263  *
19264  * @cname('__pyx_memoryview_err_extents')
19265  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19266  * Py_ssize_t extent2) except -1 with gil:
19267  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19268  */
19269 
19270 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19271  int __pyx_r;
19272  __Pyx_RefNannyDeclarations
19273  PyObject *__pyx_t_1 = NULL;
19274  PyObject *__pyx_t_2 = NULL;
19275  PyObject *__pyx_t_3 = NULL;
19276  PyObject *__pyx_t_4 = NULL;
19277  int __pyx_lineno = 0;
19278  const char *__pyx_filename = NULL;
19279  int __pyx_clineno = 0;
19280  #ifdef WITH_THREAD
19281  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19282  #endif
19283  __Pyx_RefNannySetupContext("_err_extents", 0);
19284 
19285  /* "View.MemoryView":1254
19286  * Py_ssize_t extent2) except -1 with gil:
19287  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19288  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19289  *
19290  * @cname('__pyx_memoryview_err_dim')
19291  */
19292  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19293  __Pyx_GOTREF(__pyx_t_1);
19294  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19295  __Pyx_GOTREF(__pyx_t_2);
19296  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19297  __Pyx_GOTREF(__pyx_t_3);
19298  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19299  __Pyx_GOTREF(__pyx_t_4);
19300  __Pyx_GIVEREF(__pyx_t_1);
19301  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19302  __Pyx_GIVEREF(__pyx_t_2);
19303  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19304  __Pyx_GIVEREF(__pyx_t_3);
19305  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19306  __pyx_t_1 = 0;
19307  __pyx_t_2 = 0;
19308  __pyx_t_3 = 0;
19309 
19310  /* "View.MemoryView":1253
19311  * cdef int _err_extents(int i, Py_ssize_t extent1,
19312  * Py_ssize_t extent2) except -1 with gil:
19313  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19314  * (i, extent1, extent2))
19315  *
19316  */
19317  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19318  __Pyx_GOTREF(__pyx_t_3);
19319  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19320  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19321  __Pyx_GOTREF(__pyx_t_4);
19322  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19323  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19324  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19325  __PYX_ERR(1, 1253, __pyx_L1_error)
19326 
19327  /* "View.MemoryView":1251
19328  *
19329  * @cname('__pyx_memoryview_err_extents')
19330  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19331  * Py_ssize_t extent2) except -1 with gil:
19332  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19333  */
19334 
19335  /* function exit code */
19336  __pyx_L1_error:;
19337  __Pyx_XDECREF(__pyx_t_1);
19338  __Pyx_XDECREF(__pyx_t_2);
19339  __Pyx_XDECREF(__pyx_t_3);
19340  __Pyx_XDECREF(__pyx_t_4);
19341  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19342  __pyx_r = -1;
19343  __Pyx_RefNannyFinishContext();
19344  #ifdef WITH_THREAD
19345  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19346  #endif
19347  return __pyx_r;
19348 }
19349 
19350 /* "View.MemoryView":1257
19351  *
19352  * @cname('__pyx_memoryview_err_dim')
19353  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19354  * raise error(msg.decode('ascii') % dim)
19355  *
19356  */
19357 
19358 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19359  int __pyx_r;
19360  __Pyx_RefNannyDeclarations
19361  PyObject *__pyx_t_1 = NULL;
19362  PyObject *__pyx_t_2 = NULL;
19363  PyObject *__pyx_t_3 = NULL;
19364  PyObject *__pyx_t_4 = NULL;
19365  int __pyx_lineno = 0;
19366  const char *__pyx_filename = NULL;
19367  int __pyx_clineno = 0;
19368  #ifdef WITH_THREAD
19369  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19370  #endif
19371  __Pyx_RefNannySetupContext("_err_dim", 0);
19372  __Pyx_INCREF(__pyx_v_error);
19373 
19374  /* "View.MemoryView":1258
19375  * @cname('__pyx_memoryview_err_dim')
19376  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19377  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19378  *
19379  * @cname('__pyx_memoryview_err')
19380  */
19381  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19382  __Pyx_GOTREF(__pyx_t_2);
19383  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19384  __Pyx_GOTREF(__pyx_t_3);
19385  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19386  __Pyx_GOTREF(__pyx_t_4);
19387  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19388  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19389  __Pyx_INCREF(__pyx_v_error);
19390  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19391  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19392  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19393  if (likely(__pyx_t_2)) {
19394  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19395  __Pyx_INCREF(__pyx_t_2);
19396  __Pyx_INCREF(function);
19397  __Pyx_DECREF_SET(__pyx_t_3, function);
19398  }
19399  }
19400  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19401  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19402  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19403  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19404  __Pyx_GOTREF(__pyx_t_1);
19405  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19406  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19407  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19408  __PYX_ERR(1, 1258, __pyx_L1_error)
19409 
19410  /* "View.MemoryView":1257
19411  *
19412  * @cname('__pyx_memoryview_err_dim')
19413  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19414  * raise error(msg.decode('ascii') % dim)
19415  *
19416  */
19417 
19418  /* function exit code */
19419  __pyx_L1_error:;
19420  __Pyx_XDECREF(__pyx_t_1);
19421  __Pyx_XDECREF(__pyx_t_2);
19422  __Pyx_XDECREF(__pyx_t_3);
19423  __Pyx_XDECREF(__pyx_t_4);
19424  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19425  __pyx_r = -1;
19426  __Pyx_XDECREF(__pyx_v_error);
19427  __Pyx_RefNannyFinishContext();
19428  #ifdef WITH_THREAD
19429  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19430  #endif
19431  return __pyx_r;
19432 }
19433 
19434 /* "View.MemoryView":1261
19435  *
19436  * @cname('__pyx_memoryview_err')
19437  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19438  * if msg != NULL:
19439  * raise error(msg.decode('ascii'))
19440  */
19441 
19442 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19443  int __pyx_r;
19444  __Pyx_RefNannyDeclarations
19445  int __pyx_t_1;
19446  PyObject *__pyx_t_2 = NULL;
19447  PyObject *__pyx_t_3 = NULL;
19448  PyObject *__pyx_t_4 = NULL;
19449  PyObject *__pyx_t_5 = NULL;
19450  int __pyx_lineno = 0;
19451  const char *__pyx_filename = NULL;
19452  int __pyx_clineno = 0;
19453  #ifdef WITH_THREAD
19454  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19455  #endif
19456  __Pyx_RefNannySetupContext("_err", 0);
19457  __Pyx_INCREF(__pyx_v_error);
19458 
19459  /* "View.MemoryView":1262
19460  * @cname('__pyx_memoryview_err')
19461  * cdef int _err(object error, char *msg) except -1 with gil:
19462  * if msg != NULL: # <<<<<<<<<<<<<<
19463  * raise error(msg.decode('ascii'))
19464  * else:
19465  */
19466  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19467  if (unlikely(__pyx_t_1)) {
19468 
19469  /* "View.MemoryView":1263
19470  * cdef int _err(object error, char *msg) except -1 with gil:
19471  * if msg != NULL:
19472  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19473  * else:
19474  * raise error
19475  */
19476  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19477  __Pyx_GOTREF(__pyx_t_3);
19478  __Pyx_INCREF(__pyx_v_error);
19479  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19480  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19481  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19482  if (likely(__pyx_t_5)) {
19483  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19484  __Pyx_INCREF(__pyx_t_5);
19485  __Pyx_INCREF(function);
19486  __Pyx_DECREF_SET(__pyx_t_4, function);
19487  }
19488  }
19489  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19490  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19491  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19492  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19493  __Pyx_GOTREF(__pyx_t_2);
19494  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19495  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19496  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19497  __PYX_ERR(1, 1263, __pyx_L1_error)
19498 
19499  /* "View.MemoryView":1262
19500  * @cname('__pyx_memoryview_err')
19501  * cdef int _err(object error, char *msg) except -1 with gil:
19502  * if msg != NULL: # <<<<<<<<<<<<<<
19503  * raise error(msg.decode('ascii'))
19504  * else:
19505  */
19506  }
19507 
19508  /* "View.MemoryView":1265
19509  * raise error(msg.decode('ascii'))
19510  * else:
19511  * raise error # <<<<<<<<<<<<<<
19512  *
19513  * @cname('__pyx_memoryview_copy_contents')
19514  */
19515  /*else*/ {
19516  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19517  __PYX_ERR(1, 1265, __pyx_L1_error)
19518  }
19519 
19520  /* "View.MemoryView":1261
19521  *
19522  * @cname('__pyx_memoryview_err')
19523  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19524  * if msg != NULL:
19525  * raise error(msg.decode('ascii'))
19526  */
19527 
19528  /* function exit code */
19529  __pyx_L1_error:;
19530  __Pyx_XDECREF(__pyx_t_2);
19531  __Pyx_XDECREF(__pyx_t_3);
19532  __Pyx_XDECREF(__pyx_t_4);
19533  __Pyx_XDECREF(__pyx_t_5);
19534  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19535  __pyx_r = -1;
19536  __Pyx_XDECREF(__pyx_v_error);
19537  __Pyx_RefNannyFinishContext();
19538  #ifdef WITH_THREAD
19539  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19540  #endif
19541  return __pyx_r;
19542 }
19543 
19544 /* "View.MemoryView":1268
19545  *
19546  * @cname('__pyx_memoryview_copy_contents')
19547  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19548  * __Pyx_memviewslice dst,
19549  * int src_ndim, int dst_ndim,
19550  */
19551 
19552 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19553  void *__pyx_v_tmpdata;
19554  size_t __pyx_v_itemsize;
19555  int __pyx_v_i;
19556  char __pyx_v_order;
19557  int __pyx_v_broadcasting;
19558  int __pyx_v_direct_copy;
19559  __Pyx_memviewslice __pyx_v_tmp;
19560  int __pyx_v_ndim;
19561  int __pyx_r;
19562  Py_ssize_t __pyx_t_1;
19563  int __pyx_t_2;
19564  int __pyx_t_3;
19565  int __pyx_t_4;
19566  int __pyx_t_5;
19567  int __pyx_t_6;
19568  void *__pyx_t_7;
19569  int __pyx_t_8;
19570  int __pyx_lineno = 0;
19571  const char *__pyx_filename = NULL;
19572  int __pyx_clineno = 0;
19573 
19574  /* "View.MemoryView":1276
19575  * Check for overlapping memory and verify the shapes.
19576  * """
19577  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19578  * cdef size_t itemsize = src.memview.view.itemsize
19579  * cdef int i
19580  */
19581  __pyx_v_tmpdata = NULL;
19582 
19583  /* "View.MemoryView":1277
19584  * """
19585  * cdef void *tmpdata = NULL
19586  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19587  * cdef int i
19588  * cdef char order = get_best_order(&src, src_ndim)
19589  */
19590  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19591  __pyx_v_itemsize = __pyx_t_1;
19592 
19593  /* "View.MemoryView":1279
19594  * cdef size_t itemsize = src.memview.view.itemsize
19595  * cdef int i
19596  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19597  * cdef bint broadcasting = False
19598  * cdef bint direct_copy = False
19599  */
19600  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19601 
19602  /* "View.MemoryView":1280
19603  * cdef int i
19604  * cdef char order = get_best_order(&src, src_ndim)
19605  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19606  * cdef bint direct_copy = False
19607  * cdef __Pyx_memviewslice tmp
19608  */
19609  __pyx_v_broadcasting = 0;
19610 
19611  /* "View.MemoryView":1281
19612  * cdef char order = get_best_order(&src, src_ndim)
19613  * cdef bint broadcasting = False
19614  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19615  * cdef __Pyx_memviewslice tmp
19616  *
19617  */
19618  __pyx_v_direct_copy = 0;
19619 
19620  /* "View.MemoryView":1284
19621  * cdef __Pyx_memviewslice tmp
19622  *
19623  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19624  * broadcast_leading(&src, src_ndim, dst_ndim)
19625  * elif dst_ndim < src_ndim:
19626  */
19627  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19628  if (__pyx_t_2) {
19629 
19630  /* "View.MemoryView":1285
19631  *
19632  * if src_ndim < dst_ndim:
19633  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19634  * elif dst_ndim < src_ndim:
19635  * broadcast_leading(&dst, dst_ndim, src_ndim)
19636  */
19637  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19638 
19639  /* "View.MemoryView":1284
19640  * cdef __Pyx_memviewslice tmp
19641  *
19642  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19643  * broadcast_leading(&src, src_ndim, dst_ndim)
19644  * elif dst_ndim < src_ndim:
19645  */
19646  goto __pyx_L3;
19647  }
19648 
19649  /* "View.MemoryView":1286
19650  * if src_ndim < dst_ndim:
19651  * broadcast_leading(&src, src_ndim, dst_ndim)
19652  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19653  * broadcast_leading(&dst, dst_ndim, src_ndim)
19654  *
19655  */
19656  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19657  if (__pyx_t_2) {
19658 
19659  /* "View.MemoryView":1287
19660  * broadcast_leading(&src, src_ndim, dst_ndim)
19661  * elif dst_ndim < src_ndim:
19662  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19663  *
19664  * cdef int ndim = max(src_ndim, dst_ndim)
19665  */
19666  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19667 
19668  /* "View.MemoryView":1286
19669  * if src_ndim < dst_ndim:
19670  * broadcast_leading(&src, src_ndim, dst_ndim)
19671  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19672  * broadcast_leading(&dst, dst_ndim, src_ndim)
19673  *
19674  */
19675  }
19676  __pyx_L3:;
19677 
19678  /* "View.MemoryView":1289
19679  * broadcast_leading(&dst, dst_ndim, src_ndim)
19680  *
19681  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19682  *
19683  * for i in range(ndim):
19684  */
19685  __pyx_t_3 = __pyx_v_dst_ndim;
19686  __pyx_t_4 = __pyx_v_src_ndim;
19687  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19688  __pyx_t_5 = __pyx_t_3;
19689  } else {
19690  __pyx_t_5 = __pyx_t_4;
19691  }
19692  __pyx_v_ndim = __pyx_t_5;
19693 
19694  /* "View.MemoryView":1291
19695  * cdef int ndim = max(src_ndim, dst_ndim)
19696  *
19697  * for i in range(ndim): # <<<<<<<<<<<<<<
19698  * if src.shape[i] != dst.shape[i]:
19699  * if src.shape[i] == 1:
19700  */
19701  __pyx_t_5 = __pyx_v_ndim;
19702  __pyx_t_3 = __pyx_t_5;
19703  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19704  __pyx_v_i = __pyx_t_4;
19705 
19706  /* "View.MemoryView":1292
19707  *
19708  * for i in range(ndim):
19709  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19710  * if src.shape[i] == 1:
19711  * broadcasting = True
19712  */
19713  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19714  if (__pyx_t_2) {
19715 
19716  /* "View.MemoryView":1293
19717  * for i in range(ndim):
19718  * if src.shape[i] != dst.shape[i]:
19719  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19720  * broadcasting = True
19721  * src.strides[i] = 0
19722  */
19723  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19724  if (__pyx_t_2) {
19725 
19726  /* "View.MemoryView":1294
19727  * if src.shape[i] != dst.shape[i]:
19728  * if src.shape[i] == 1:
19729  * broadcasting = True # <<<<<<<<<<<<<<
19730  * src.strides[i] = 0
19731  * else:
19732  */
19733  __pyx_v_broadcasting = 1;
19734 
19735  /* "View.MemoryView":1295
19736  * if src.shape[i] == 1:
19737  * broadcasting = True
19738  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19739  * else:
19740  * _err_extents(i, dst.shape[i], src.shape[i])
19741  */
19742  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19743 
19744  /* "View.MemoryView":1293
19745  * for i in range(ndim):
19746  * if src.shape[i] != dst.shape[i]:
19747  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19748  * broadcasting = True
19749  * src.strides[i] = 0
19750  */
19751  goto __pyx_L7;
19752  }
19753 
19754  /* "View.MemoryView":1297
19755  * src.strides[i] = 0
19756  * else:
19757  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19758  *
19759  * if src.suboffsets[i] >= 0:
19760  */
19761  /*else*/ {
19762  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19763  }
19764  __pyx_L7:;
19765 
19766  /* "View.MemoryView":1292
19767  *
19768  * for i in range(ndim):
19769  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19770  * if src.shape[i] == 1:
19771  * broadcasting = True
19772  */
19773  }
19774 
19775  /* "View.MemoryView":1299
19776  * _err_extents(i, dst.shape[i], src.shape[i])
19777  *
19778  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19779  * _err_dim(ValueError, "Dimension %d is not direct", i)
19780  *
19781  */
19782  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19783  if (__pyx_t_2) {
19784 
19785  /* "View.MemoryView":1300
19786  *
19787  * if src.suboffsets[i] >= 0:
19788  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19789  *
19790  * if slices_overlap(&src, &dst, ndim, itemsize):
19791  */
19792  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19793 
19794  /* "View.MemoryView":1299
19795  * _err_extents(i, dst.shape[i], src.shape[i])
19796  *
19797  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19798  * _err_dim(ValueError, "Dimension %d is not direct", i)
19799  *
19800  */
19801  }
19802  }
19803 
19804  /* "View.MemoryView":1302
19805  * _err_dim(ValueError, "Dimension %d is not direct", i)
19806  *
19807  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19808  *
19809  * if not slice_is_contig(src, order, ndim):
19810  */
19811  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19812  if (__pyx_t_2) {
19813 
19814  /* "View.MemoryView":1304
19815  * if slices_overlap(&src, &dst, ndim, itemsize):
19816  *
19817  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19818  * order = get_best_order(&dst, ndim)
19819  *
19820  */
19821  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19822  if (__pyx_t_2) {
19823 
19824  /* "View.MemoryView":1305
19825  *
19826  * if not slice_is_contig(src, order, ndim):
19827  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19828  *
19829  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19830  */
19831  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19832 
19833  /* "View.MemoryView":1304
19834  * if slices_overlap(&src, &dst, ndim, itemsize):
19835  *
19836  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19837  * order = get_best_order(&dst, ndim)
19838  *
19839  */
19840  }
19841 
19842  /* "View.MemoryView":1307
19843  * order = get_best_order(&dst, ndim)
19844  *
19845  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19846  * src = tmp
19847  *
19848  */
19849  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19850  __pyx_v_tmpdata = __pyx_t_7;
19851 
19852  /* "View.MemoryView":1308
19853  *
19854  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19855  * src = tmp # <<<<<<<<<<<<<<
19856  *
19857  * if not broadcasting:
19858  */
19859  __pyx_v_src = __pyx_v_tmp;
19860 
19861  /* "View.MemoryView":1302
19862  * _err_dim(ValueError, "Dimension %d is not direct", i)
19863  *
19864  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19865  *
19866  * if not slice_is_contig(src, order, ndim):
19867  */
19868  }
19869 
19870  /* "View.MemoryView":1310
19871  * src = tmp
19872  *
19873  * if not broadcasting: # <<<<<<<<<<<<<<
19874  *
19875  *
19876  */
19877  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19878  if (__pyx_t_2) {
19879 
19880  /* "View.MemoryView":1313
19881  *
19882  *
19883  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19884  * direct_copy = slice_is_contig(dst, 'C', ndim)
19885  * elif slice_is_contig(src, 'F', ndim):
19886  */
19887  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19888  if (__pyx_t_2) {
19889 
19890  /* "View.MemoryView":1314
19891  *
19892  * if slice_is_contig(src, 'C', ndim):
19893  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19894  * elif slice_is_contig(src, 'F', ndim):
19895  * direct_copy = slice_is_contig(dst, 'F', ndim)
19896  */
19897  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19898 
19899  /* "View.MemoryView":1313
19900  *
19901  *
19902  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19903  * direct_copy = slice_is_contig(dst, 'C', ndim)
19904  * elif slice_is_contig(src, 'F', ndim):
19905  */
19906  goto __pyx_L12;
19907  }
19908 
19909  /* "View.MemoryView":1315
19910  * if slice_is_contig(src, 'C', ndim):
19911  * direct_copy = slice_is_contig(dst, 'C', ndim)
19912  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19913  * direct_copy = slice_is_contig(dst, 'F', ndim)
19914  *
19915  */
19916  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19917  if (__pyx_t_2) {
19918 
19919  /* "View.MemoryView":1316
19920  * direct_copy = slice_is_contig(dst, 'C', ndim)
19921  * elif slice_is_contig(src, 'F', ndim):
19922  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19923  *
19924  * if direct_copy:
19925  */
19926  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19927 
19928  /* "View.MemoryView":1315
19929  * if slice_is_contig(src, 'C', ndim):
19930  * direct_copy = slice_is_contig(dst, 'C', ndim)
19931  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19932  * direct_copy = slice_is_contig(dst, 'F', ndim)
19933  *
19934  */
19935  }
19936  __pyx_L12:;
19937 
19938  /* "View.MemoryView":1318
19939  * direct_copy = slice_is_contig(dst, 'F', ndim)
19940  *
19941  * if direct_copy: # <<<<<<<<<<<<<<
19942  *
19943  * refcount_copying(&dst, dtype_is_object, ndim, False)
19944  */
19945  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19946  if (__pyx_t_2) {
19947 
19948  /* "View.MemoryView":1320
19949  * if direct_copy:
19950  *
19951  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19952  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19953  * refcount_copying(&dst, dtype_is_object, ndim, True)
19954  */
19955  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19956 
19957  /* "View.MemoryView":1321
19958  *
19959  * refcount_copying(&dst, dtype_is_object, ndim, False)
19960  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19961  * refcount_copying(&dst, dtype_is_object, ndim, True)
19962  * free(tmpdata)
19963  */
19964  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19965 
19966  /* "View.MemoryView":1322
19967  * refcount_copying(&dst, dtype_is_object, ndim, False)
19968  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19969  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19970  * free(tmpdata)
19971  * return 0
19972  */
19973  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19974 
19975  /* "View.MemoryView":1323
19976  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19977  * refcount_copying(&dst, dtype_is_object, ndim, True)
19978  * free(tmpdata) # <<<<<<<<<<<<<<
19979  * return 0
19980  *
19981  */
19982  free(__pyx_v_tmpdata);
19983 
19984  /* "View.MemoryView":1324
19985  * refcount_copying(&dst, dtype_is_object, ndim, True)
19986  * free(tmpdata)
19987  * return 0 # <<<<<<<<<<<<<<
19988  *
19989  * if order == 'F' == get_best_order(&dst, ndim):
19990  */
19991  __pyx_r = 0;
19992  goto __pyx_L0;
19993 
19994  /* "View.MemoryView":1318
19995  * direct_copy = slice_is_contig(dst, 'F', ndim)
19996  *
19997  * if direct_copy: # <<<<<<<<<<<<<<
19998  *
19999  * refcount_copying(&dst, dtype_is_object, ndim, False)
20000  */
20001  }
20002 
20003  /* "View.MemoryView":1310
20004  * src = tmp
20005  *
20006  * if not broadcasting: # <<<<<<<<<<<<<<
20007  *
20008  *
20009  */
20010  }
20011 
20012  /* "View.MemoryView":1326
20013  * return 0
20014  *
20015  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20016  *
20017  *
20018  */
20019  __pyx_t_2 = (__pyx_v_order == 'F');
20020  if (__pyx_t_2) {
20021  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20022  }
20023  __pyx_t_8 = (__pyx_t_2 != 0);
20024  if (__pyx_t_8) {
20025 
20026  /* "View.MemoryView":1329
20027  *
20028  *
20029  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20030  * transpose_memslice(&dst)
20031  *
20032  */
20033  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20034 
20035  /* "View.MemoryView":1330
20036  *
20037  * transpose_memslice(&src)
20038  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20039  *
20040  * refcount_copying(&dst, dtype_is_object, ndim, False)
20041  */
20042  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20043 
20044  /* "View.MemoryView":1326
20045  * return 0
20046  *
20047  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20048  *
20049  *
20050  */
20051  }
20052 
20053  /* "View.MemoryView":1332
20054  * transpose_memslice(&dst)
20055  *
20056  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20057  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20058  * refcount_copying(&dst, dtype_is_object, ndim, True)
20059  */
20060  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20061 
20062  /* "View.MemoryView":1333
20063  *
20064  * refcount_copying(&dst, dtype_is_object, ndim, False)
20065  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20066  * refcount_copying(&dst, dtype_is_object, ndim, True)
20067  *
20068  */
20069  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20070 
20071  /* "View.MemoryView":1334
20072  * refcount_copying(&dst, dtype_is_object, ndim, False)
20073  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20074  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20075  *
20076  * free(tmpdata)
20077  */
20078  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20079 
20080  /* "View.MemoryView":1336
20081  * refcount_copying(&dst, dtype_is_object, ndim, True)
20082  *
20083  * free(tmpdata) # <<<<<<<<<<<<<<
20084  * return 0
20085  *
20086  */
20087  free(__pyx_v_tmpdata);
20088 
20089  /* "View.MemoryView":1337
20090  *
20091  * free(tmpdata)
20092  * return 0 # <<<<<<<<<<<<<<
20093  *
20094  * @cname('__pyx_memoryview_broadcast_leading')
20095  */
20096  __pyx_r = 0;
20097  goto __pyx_L0;
20098 
20099  /* "View.MemoryView":1268
20100  *
20101  * @cname('__pyx_memoryview_copy_contents')
20102  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20103  * __Pyx_memviewslice dst,
20104  * int src_ndim, int dst_ndim,
20105  */
20106 
20107  /* function exit code */
20108  __pyx_L1_error:;
20109  {
20110  #ifdef WITH_THREAD
20111  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20112  #endif
20113  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20114  #ifdef WITH_THREAD
20115  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20116  #endif
20117  }
20118  __pyx_r = -1;
20119  __pyx_L0:;
20120  return __pyx_r;
20121 }
20122 
20123 /* "View.MemoryView":1340
20124  *
20125  * @cname('__pyx_memoryview_broadcast_leading')
20126  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20127  * int ndim,
20128  * int ndim_other) nogil:
20129  */
20130 
20131 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20132  int __pyx_v_i;
20133  int __pyx_v_offset;
20134  int __pyx_t_1;
20135  int __pyx_t_2;
20136  int __pyx_t_3;
20137 
20138  /* "View.MemoryView":1344
20139  * int ndim_other) nogil:
20140  * cdef int i
20141  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20142  *
20143  * for i in range(ndim - 1, -1, -1):
20144  */
20145  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20146 
20147  /* "View.MemoryView":1346
20148  * cdef int offset = ndim_other - ndim
20149  *
20150  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20151  * mslice.shape[i + offset] = mslice.shape[i]
20152  * mslice.strides[i + offset] = mslice.strides[i]
20153  */
20154  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20155  __pyx_v_i = __pyx_t_1;
20156 
20157  /* "View.MemoryView":1347
20158  *
20159  * for i in range(ndim - 1, -1, -1):
20160  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20161  * mslice.strides[i + offset] = mslice.strides[i]
20162  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20163  */
20164  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20165 
20166  /* "View.MemoryView":1348
20167  * for i in range(ndim - 1, -1, -1):
20168  * mslice.shape[i + offset] = mslice.shape[i]
20169  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20170  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20171  *
20172  */
20173  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20174 
20175  /* "View.MemoryView":1349
20176  * mslice.shape[i + offset] = mslice.shape[i]
20177  * mslice.strides[i + offset] = mslice.strides[i]
20178  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20179  *
20180  * for i in range(offset):
20181  */
20182  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20183  }
20184 
20185  /* "View.MemoryView":1351
20186  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20187  *
20188  * for i in range(offset): # <<<<<<<<<<<<<<
20189  * mslice.shape[i] = 1
20190  * mslice.strides[i] = mslice.strides[0]
20191  */
20192  __pyx_t_1 = __pyx_v_offset;
20193  __pyx_t_2 = __pyx_t_1;
20194  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20195  __pyx_v_i = __pyx_t_3;
20196 
20197  /* "View.MemoryView":1352
20198  *
20199  * for i in range(offset):
20200  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20201  * mslice.strides[i] = mslice.strides[0]
20202  * mslice.suboffsets[i] = -1
20203  */
20204  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20205 
20206  /* "View.MemoryView":1353
20207  * for i in range(offset):
20208  * mslice.shape[i] = 1
20209  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20210  * mslice.suboffsets[i] = -1
20211  *
20212  */
20213  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20214 
20215  /* "View.MemoryView":1354
20216  * mslice.shape[i] = 1
20217  * mslice.strides[i] = mslice.strides[0]
20218  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20219  *
20220  *
20221  */
20222  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20223  }
20224 
20225  /* "View.MemoryView":1340
20226  *
20227  * @cname('__pyx_memoryview_broadcast_leading')
20228  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20229  * int ndim,
20230  * int ndim_other) nogil:
20231  */
20232 
20233  /* function exit code */
20234 }
20235 
20236 /* "View.MemoryView":1362
20237  *
20238  * @cname('__pyx_memoryview_refcount_copying')
20239  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20240  * int ndim, bint inc) nogil:
20241  *
20242  */
20243 
20244 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
20245  int __pyx_t_1;
20246 
20247  /* "View.MemoryView":1366
20248  *
20249  *
20250  * if dtype_is_object: # <<<<<<<<<<<<<<
20251  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20252  * dst.strides, ndim, inc)
20253  */
20254  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20255  if (__pyx_t_1) {
20256 
20257  /* "View.MemoryView":1367
20258  *
20259  * if dtype_is_object:
20260  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20261  * dst.strides, ndim, inc)
20262  *
20263  */
20264  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20265 
20266  /* "View.MemoryView":1366
20267  *
20268  *
20269  * if dtype_is_object: # <<<<<<<<<<<<<<
20270  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20271  * dst.strides, ndim, inc)
20272  */
20273  }
20274 
20275  /* "View.MemoryView":1362
20276  *
20277  * @cname('__pyx_memoryview_refcount_copying')
20278  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20279  * int ndim, bint inc) nogil:
20280  *
20281  */
20282 
20283  /* function exit code */
20284 }
20285 
20286 /* "View.MemoryView":1371
20287  *
20288  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20289  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20290  * Py_ssize_t *strides, int ndim,
20291  * bint inc) with gil:
20292  */
20293 
20294 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20295  __Pyx_RefNannyDeclarations
20296  #ifdef WITH_THREAD
20297  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20298  #endif
20299  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20300 
20301  /* "View.MemoryView":1374
20302  * Py_ssize_t *strides, int ndim,
20303  * bint inc) with gil:
20304  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20305  *
20306  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20307  */
20308  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20309 
20310  /* "View.MemoryView":1371
20311  *
20312  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20313  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20314  * Py_ssize_t *strides, int ndim,
20315  * bint inc) with gil:
20316  */
20317 
20318  /* function exit code */
20319  __Pyx_RefNannyFinishContext();
20320  #ifdef WITH_THREAD
20321  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20322  #endif
20323 }
20324 
20325 /* "View.MemoryView":1377
20326  *
20327  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20328  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20329  * Py_ssize_t *strides, int ndim, bint inc):
20330  * cdef Py_ssize_t i
20331  */
20332 
20333 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20334  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20335  __Pyx_RefNannyDeclarations
20336  Py_ssize_t __pyx_t_1;
20337  Py_ssize_t __pyx_t_2;
20338  Py_ssize_t __pyx_t_3;
20339  int __pyx_t_4;
20340  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20341 
20342  /* "View.MemoryView":1381
20343  * cdef Py_ssize_t i
20344  *
20345  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20346  * if ndim == 1:
20347  * if inc:
20348  */
20349  __pyx_t_1 = (__pyx_v_shape[0]);
20350  __pyx_t_2 = __pyx_t_1;
20351  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20352  __pyx_v_i = __pyx_t_3;
20353 
20354  /* "View.MemoryView":1382
20355  *
20356  * for i in range(shape[0]):
20357  * if ndim == 1: # <<<<<<<<<<<<<<
20358  * if inc:
20359  * Py_INCREF((<PyObject **> data)[0])
20360  */
20361  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20362  if (__pyx_t_4) {
20363 
20364  /* "View.MemoryView":1383
20365  * for i in range(shape[0]):
20366  * if ndim == 1:
20367  * if inc: # <<<<<<<<<<<<<<
20368  * Py_INCREF((<PyObject **> data)[0])
20369  * else:
20370  */
20371  __pyx_t_4 = (__pyx_v_inc != 0);
20372  if (__pyx_t_4) {
20373 
20374  /* "View.MemoryView":1384
20375  * if ndim == 1:
20376  * if inc:
20377  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20378  * else:
20379  * Py_DECREF((<PyObject **> data)[0])
20380  */
20381  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20382 
20383  /* "View.MemoryView":1383
20384  * for i in range(shape[0]):
20385  * if ndim == 1:
20386  * if inc: # <<<<<<<<<<<<<<
20387  * Py_INCREF((<PyObject **> data)[0])
20388  * else:
20389  */
20390  goto __pyx_L6;
20391  }
20392 
20393  /* "View.MemoryView":1386
20394  * Py_INCREF((<PyObject **> data)[0])
20395  * else:
20396  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20397  * else:
20398  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20399  */
20400  /*else*/ {
20401  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20402  }
20403  __pyx_L6:;
20404 
20405  /* "View.MemoryView":1382
20406  *
20407  * for i in range(shape[0]):
20408  * if ndim == 1: # <<<<<<<<<<<<<<
20409  * if inc:
20410  * Py_INCREF((<PyObject **> data)[0])
20411  */
20412  goto __pyx_L5;
20413  }
20414 
20415  /* "View.MemoryView":1388
20416  * Py_DECREF((<PyObject **> data)[0])
20417  * else:
20418  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20419  * ndim - 1, inc)
20420  *
20421  */
20422  /*else*/ {
20423 
20424  /* "View.MemoryView":1389
20425  * else:
20426  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20427  * ndim - 1, inc) # <<<<<<<<<<<<<<
20428  *
20429  * data += strides[0]
20430  */
20431  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20432  }
20433  __pyx_L5:;
20434 
20435  /* "View.MemoryView":1391
20436  * ndim - 1, inc)
20437  *
20438  * data += strides[0] # <<<<<<<<<<<<<<
20439  *
20440  *
20441  */
20442  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20443  }
20444 
20445  /* "View.MemoryView":1377
20446  *
20447  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20448  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20449  * Py_ssize_t *strides, int ndim, bint inc):
20450  * cdef Py_ssize_t i
20451  */
20452 
20453  /* function exit code */
20454  __Pyx_RefNannyFinishContext();
20455 }
20456 
20457 /* "View.MemoryView":1397
20458  *
20459  * @cname('__pyx_memoryview_slice_assign_scalar')
20460  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20461  * size_t itemsize, void *item,
20462  * bint dtype_is_object) nogil:
20463  */
20464 
20465 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20466 
20467  /* "View.MemoryView":1400
20468  * size_t itemsize, void *item,
20469  * bint dtype_is_object) nogil:
20470  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20471  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20472  * itemsize, item)
20473  */
20474  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20475 
20476  /* "View.MemoryView":1401
20477  * bint dtype_is_object) nogil:
20478  * refcount_copying(dst, dtype_is_object, ndim, False)
20479  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20480  * itemsize, item)
20481  * refcount_copying(dst, dtype_is_object, ndim, True)
20482  */
20483  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20484 
20485  /* "View.MemoryView":1403
20486  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20487  * itemsize, item)
20488  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20489  *
20490  *
20491  */
20492  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20493 
20494  /* "View.MemoryView":1397
20495  *
20496  * @cname('__pyx_memoryview_slice_assign_scalar')
20497  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20498  * size_t itemsize, void *item,
20499  * bint dtype_is_object) nogil:
20500  */
20501 
20502  /* function exit code */
20503 }
20504 
20505 /* "View.MemoryView":1407
20506  *
20507  * @cname('__pyx_memoryview__slice_assign_scalar')
20508  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20509  * Py_ssize_t *strides, int ndim,
20510  * size_t itemsize, void *item) nogil:
20511  */
20512 
20513 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20514  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20515  Py_ssize_t __pyx_v_stride;
20516  Py_ssize_t __pyx_v_extent;
20517  int __pyx_t_1;
20518  Py_ssize_t __pyx_t_2;
20519  Py_ssize_t __pyx_t_3;
20520  Py_ssize_t __pyx_t_4;
20521 
20522  /* "View.MemoryView":1411
20523  * size_t itemsize, void *item) nogil:
20524  * cdef Py_ssize_t i
20525  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20526  * cdef Py_ssize_t extent = shape[0]
20527  *
20528  */
20529  __pyx_v_stride = (__pyx_v_strides[0]);
20530 
20531  /* "View.MemoryView":1412
20532  * cdef Py_ssize_t i
20533  * cdef Py_ssize_t stride = strides[0]
20534  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20535  *
20536  * if ndim == 1:
20537  */
20538  __pyx_v_extent = (__pyx_v_shape[0]);
20539 
20540  /* "View.MemoryView":1414
20541  * cdef Py_ssize_t extent = shape[0]
20542  *
20543  * if ndim == 1: # <<<<<<<<<<<<<<
20544  * for i in range(extent):
20545  * memcpy(data, item, itemsize)
20546  */
20547  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20548  if (__pyx_t_1) {
20549 
20550  /* "View.MemoryView":1415
20551  *
20552  * if ndim == 1:
20553  * for i in range(extent): # <<<<<<<<<<<<<<
20554  * memcpy(data, item, itemsize)
20555  * data += stride
20556  */
20557  __pyx_t_2 = __pyx_v_extent;
20558  __pyx_t_3 = __pyx_t_2;
20559  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20560  __pyx_v_i = __pyx_t_4;
20561 
20562  /* "View.MemoryView":1416
20563  * if ndim == 1:
20564  * for i in range(extent):
20565  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20566  * data += stride
20567  * else:
20568  */
20569  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20570 
20571  /* "View.MemoryView":1417
20572  * for i in range(extent):
20573  * memcpy(data, item, itemsize)
20574  * data += stride # <<<<<<<<<<<<<<
20575  * else:
20576  * for i in range(extent):
20577  */
20578  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20579  }
20580 
20581  /* "View.MemoryView":1414
20582  * cdef Py_ssize_t extent = shape[0]
20583  *
20584  * if ndim == 1: # <<<<<<<<<<<<<<
20585  * for i in range(extent):
20586  * memcpy(data, item, itemsize)
20587  */
20588  goto __pyx_L3;
20589  }
20590 
20591  /* "View.MemoryView":1419
20592  * data += stride
20593  * else:
20594  * for i in range(extent): # <<<<<<<<<<<<<<
20595  * _slice_assign_scalar(data, shape + 1, strides + 1,
20596  * ndim - 1, itemsize, item)
20597  */
20598  /*else*/ {
20599  __pyx_t_2 = __pyx_v_extent;
20600  __pyx_t_3 = __pyx_t_2;
20601  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20602  __pyx_v_i = __pyx_t_4;
20603 
20604  /* "View.MemoryView":1420
20605  * else:
20606  * for i in range(extent):
20607  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20608  * ndim - 1, itemsize, item)
20609  * data += stride
20610  */
20611  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20612 
20613  /* "View.MemoryView":1422
20614  * _slice_assign_scalar(data, shape + 1, strides + 1,
20615  * ndim - 1, itemsize, item)
20616  * data += stride # <<<<<<<<<<<<<<
20617  *
20618  *
20619  */
20620  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20621  }
20622  }
20623  __pyx_L3:;
20624 
20625  /* "View.MemoryView":1407
20626  *
20627  * @cname('__pyx_memoryview__slice_assign_scalar')
20628  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20629  * Py_ssize_t *strides, int ndim,
20630  * size_t itemsize, void *item) nogil:
20631  */
20632 
20633  /* function exit code */
20634 }
20635 
20636 /* "(tree fragment)":1
20637  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20638  * cdef object __pyx_PickleError
20639  * cdef object __pyx_result
20640  */
20641 
20642 /* Python wrapper */
20643 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20644 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20645 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20646  PyObject *__pyx_v___pyx_type = 0;
20647  long __pyx_v___pyx_checksum;
20648  PyObject *__pyx_v___pyx_state = 0;
20649  int __pyx_lineno = 0;
20650  const char *__pyx_filename = NULL;
20651  int __pyx_clineno = 0;
20652  PyObject *__pyx_r = 0;
20653  __Pyx_RefNannyDeclarations
20654  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20655  {
20656  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20657  PyObject* values[3] = {0,0,0};
20658  if (unlikely(__pyx_kwds)) {
20659  Py_ssize_t kw_args;
20660  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20661  switch (pos_args) {
20662  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20663  CYTHON_FALLTHROUGH;
20664  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20665  CYTHON_FALLTHROUGH;
20666  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20667  CYTHON_FALLTHROUGH;
20668  case 0: break;
20669  default: goto __pyx_L5_argtuple_error;
20670  }
20671  kw_args = PyDict_Size(__pyx_kwds);
20672  switch (pos_args) {
20673  case 0:
20674  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20675  else goto __pyx_L5_argtuple_error;
20676  CYTHON_FALLTHROUGH;
20677  case 1:
20678  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20679  else {
20680  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20681  }
20682  CYTHON_FALLTHROUGH;
20683  case 2:
20684  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20685  else {
20686  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20687  }
20688  }
20689  if (unlikely(kw_args > 0)) {
20690  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20691  }
20692  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20693  goto __pyx_L5_argtuple_error;
20694  } else {
20695  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20696  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20697  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20698  }
20699  __pyx_v___pyx_type = values[0];
20700  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20701  __pyx_v___pyx_state = values[2];
20702  }
20703  goto __pyx_L4_argument_unpacking_done;
20704  __pyx_L5_argtuple_error:;
20705  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20706  __pyx_L3_error:;
20707  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20708  __Pyx_RefNannyFinishContext();
20709  return NULL;
20710  __pyx_L4_argument_unpacking_done:;
20711  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20712 
20713  /* function exit code */
20714  __Pyx_RefNannyFinishContext();
20715  return __pyx_r;
20716 }
20717 
20718 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20719  PyObject *__pyx_v___pyx_PickleError = 0;
20720  PyObject *__pyx_v___pyx_result = 0;
20721  PyObject *__pyx_r = NULL;
20722  __Pyx_RefNannyDeclarations
20723  int __pyx_t_1;
20724  PyObject *__pyx_t_2 = NULL;
20725  PyObject *__pyx_t_3 = NULL;
20726  PyObject *__pyx_t_4 = NULL;
20727  PyObject *__pyx_t_5 = NULL;
20728  int __pyx_t_6;
20729  int __pyx_lineno = 0;
20730  const char *__pyx_filename = NULL;
20731  int __pyx_clineno = 0;
20732  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20733 
20734  /* "(tree fragment)":4
20735  * cdef object __pyx_PickleError
20736  * cdef object __pyx_result
20737  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20738  * from pickle import PickleError as __pyx_PickleError
20739  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20740  */
20741  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20742  if (__pyx_t_1) {
20743 
20744  /* "(tree fragment)":5
20745  * cdef object __pyx_result
20746  * if __pyx_checksum != 0xb068931:
20747  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20748  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20749  * __pyx_result = Enum.__new__(__pyx_type)
20750  */
20751  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20752  __Pyx_GOTREF(__pyx_t_2);
20753  __Pyx_INCREF(__pyx_n_s_PickleError);
20754  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20755  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20756  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20757  __Pyx_GOTREF(__pyx_t_3);
20758  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20759  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20760  __Pyx_GOTREF(__pyx_t_2);
20761  __Pyx_INCREF(__pyx_t_2);
20762  __pyx_v___pyx_PickleError = __pyx_t_2;
20763  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20764  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20765 
20766  /* "(tree fragment)":6
20767  * if __pyx_checksum != 0xb068931:
20768  * from pickle import PickleError as __pyx_PickleError
20769  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20770  * __pyx_result = Enum.__new__(__pyx_type)
20771  * if __pyx_state is not None:
20772  */
20773  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
20774  __Pyx_GOTREF(__pyx_t_2);
20775  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20776  __Pyx_GOTREF(__pyx_t_4);
20777  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20778  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20779  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20780  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20781  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20782  if (likely(__pyx_t_5)) {
20783  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20784  __Pyx_INCREF(__pyx_t_5);
20785  __Pyx_INCREF(function);
20786  __Pyx_DECREF_SET(__pyx_t_2, function);
20787  }
20788  }
20789  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20790  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20791  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20792  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
20793  __Pyx_GOTREF(__pyx_t_3);
20794  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20795  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20796  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20797  __PYX_ERR(1, 6, __pyx_L1_error)
20798 
20799  /* "(tree fragment)":4
20800  * cdef object __pyx_PickleError
20801  * cdef object __pyx_result
20802  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20803  * from pickle import PickleError as __pyx_PickleError
20804  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20805  */
20806  }
20807 
20808  /* "(tree fragment)":7
20809  * from pickle import PickleError as __pyx_PickleError
20810  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20811  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20812  * if __pyx_state is not None:
20813  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20814  */
20815  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
20816  __Pyx_GOTREF(__pyx_t_2);
20817  __pyx_t_4 = NULL;
20818  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20819  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20820  if (likely(__pyx_t_4)) {
20821  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20822  __Pyx_INCREF(__pyx_t_4);
20823  __Pyx_INCREF(function);
20824  __Pyx_DECREF_SET(__pyx_t_2, function);
20825  }
20826  }
20827  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
20828  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20829  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20830  __Pyx_GOTREF(__pyx_t_3);
20831  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20832  __pyx_v___pyx_result = __pyx_t_3;
20833  __pyx_t_3 = 0;
20834 
20835  /* "(tree fragment)":8
20836  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20837  * __pyx_result = Enum.__new__(__pyx_type)
20838  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20839  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20840  * return __pyx_result
20841  */
20842  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20843  __pyx_t_6 = (__pyx_t_1 != 0);
20844  if (__pyx_t_6) {
20845 
20846  /* "(tree fragment)":9
20847  * __pyx_result = Enum.__new__(__pyx_type)
20848  * if __pyx_state is not None:
20849  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20850  * return __pyx_result
20851  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20852  */
20853  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20854  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
20855  __Pyx_GOTREF(__pyx_t_3);
20856  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20857 
20858  /* "(tree fragment)":8
20859  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20860  * __pyx_result = Enum.__new__(__pyx_type)
20861  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20862  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20863  * return __pyx_result
20864  */
20865  }
20866 
20867  /* "(tree fragment)":10
20868  * if __pyx_state is not None:
20869  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20870  * return __pyx_result # <<<<<<<<<<<<<<
20871  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20872  * __pyx_result.name = __pyx_state[0]
20873  */
20874  __Pyx_XDECREF(__pyx_r);
20875  __Pyx_INCREF(__pyx_v___pyx_result);
20876  __pyx_r = __pyx_v___pyx_result;
20877  goto __pyx_L0;
20878 
20879  /* "(tree fragment)":1
20880  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20881  * cdef object __pyx_PickleError
20882  * cdef object __pyx_result
20883  */
20884 
20885  /* function exit code */
20886  __pyx_L1_error:;
20887  __Pyx_XDECREF(__pyx_t_2);
20888  __Pyx_XDECREF(__pyx_t_3);
20889  __Pyx_XDECREF(__pyx_t_4);
20890  __Pyx_XDECREF(__pyx_t_5);
20891  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20892  __pyx_r = NULL;
20893  __pyx_L0:;
20894  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20895  __Pyx_XDECREF(__pyx_v___pyx_result);
20896  __Pyx_XGIVEREF(__pyx_r);
20897  __Pyx_RefNannyFinishContext();
20898  return __pyx_r;
20899 }
20900 
20901 /* "(tree fragment)":11
20902  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20903  * return __pyx_result
20904  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20905  * __pyx_result.name = __pyx_state[0]
20906  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20907  */
20908 
20909 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20910  PyObject *__pyx_r = NULL;
20911  __Pyx_RefNannyDeclarations
20912  PyObject *__pyx_t_1 = NULL;
20913  int __pyx_t_2;
20914  Py_ssize_t __pyx_t_3;
20915  int __pyx_t_4;
20916  int __pyx_t_5;
20917  PyObject *__pyx_t_6 = NULL;
20918  PyObject *__pyx_t_7 = NULL;
20919  PyObject *__pyx_t_8 = NULL;
20920  int __pyx_lineno = 0;
20921  const char *__pyx_filename = NULL;
20922  int __pyx_clineno = 0;
20923  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20924 
20925  /* "(tree fragment)":12
20926  * return __pyx_result
20927  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20928  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20929  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20930  * __pyx_result.__dict__.update(__pyx_state[1])
20931  */
20932  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20933  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20934  __PYX_ERR(1, 12, __pyx_L1_error)
20935  }
20936  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20937  __Pyx_GOTREF(__pyx_t_1);
20938  __Pyx_GIVEREF(__pyx_t_1);
20939  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20940  __Pyx_DECREF(__pyx_v___pyx_result->name);
20941  __pyx_v___pyx_result->name = __pyx_t_1;
20942  __pyx_t_1 = 0;
20943 
20944  /* "(tree fragment)":13
20945  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20946  * __pyx_result.name = __pyx_state[0]
20947  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20948  * __pyx_result.__dict__.update(__pyx_state[1])
20949  */
20950  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20951  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20952  __PYX_ERR(1, 13, __pyx_L1_error)
20953  }
20954  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20955  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20956  if (__pyx_t_4) {
20957  } else {
20958  __pyx_t_2 = __pyx_t_4;
20959  goto __pyx_L4_bool_binop_done;
20960  }
20961  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20962  __pyx_t_5 = (__pyx_t_4 != 0);
20963  __pyx_t_2 = __pyx_t_5;
20964  __pyx_L4_bool_binop_done:;
20965  if (__pyx_t_2) {
20966 
20967  /* "(tree fragment)":14
20968  * __pyx_result.name = __pyx_state[0]
20969  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20970  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20971  */
20972  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20973  __Pyx_GOTREF(__pyx_t_6);
20974  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20975  __Pyx_GOTREF(__pyx_t_7);
20976  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20977  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20978  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20979  __PYX_ERR(1, 14, __pyx_L1_error)
20980  }
20981  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20982  __Pyx_GOTREF(__pyx_t_6);
20983  __pyx_t_8 = NULL;
20984  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20985  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20986  if (likely(__pyx_t_8)) {
20987  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20988  __Pyx_INCREF(__pyx_t_8);
20989  __Pyx_INCREF(function);
20990  __Pyx_DECREF_SET(__pyx_t_7, function);
20991  }
20992  }
20993  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20994  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20995  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20996  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20997  __Pyx_GOTREF(__pyx_t_1);
20998  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20999  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21000 
21001  /* "(tree fragment)":13
21002  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21003  * __pyx_result.name = __pyx_state[0]
21004  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21005  * __pyx_result.__dict__.update(__pyx_state[1])
21006  */
21007  }
21008 
21009  /* "(tree fragment)":11
21010  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21011  * return __pyx_result
21012  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21013  * __pyx_result.name = __pyx_state[0]
21014  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21015  */
21016 
21017  /* function exit code */
21018  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21019  goto __pyx_L0;
21020  __pyx_L1_error:;
21021  __Pyx_XDECREF(__pyx_t_1);
21022  __Pyx_XDECREF(__pyx_t_6);
21023  __Pyx_XDECREF(__pyx_t_7);
21024  __Pyx_XDECREF(__pyx_t_8);
21025  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21026  __pyx_r = 0;
21027  __pyx_L0:;
21028  __Pyx_XGIVEREF(__pyx_r);
21029  __Pyx_RefNannyFinishContext();
21030  return __pyx_r;
21031 }
21032 
21033 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21034  PyObject *o;
21035  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21036  o = (*t->tp_alloc)(t, 0);
21037  } else {
21038  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21039  }
21040  if (unlikely(!o)) return 0;
21041  if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
21042  return o;
21043  bad:
21044  Py_DECREF(o); o = 0;
21045  return NULL;
21046 }
21047 
21048 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
21049  #if CYTHON_USE_TP_FINALIZE
21050  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21051  if (PyObject_CallFinalizerFromDealloc(o)) return;
21052  }
21053  #endif
21054  {
21055  PyObject *etype, *eval, *etb;
21056  PyErr_Fetch(&etype, &eval, &etb);
21057  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21058  __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
21059  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21060  PyErr_Restore(etype, eval, etb);
21061  }
21062  (*Py_TYPE(o)->tp_free)(o);
21063 }
21064 
21065 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
21066  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21067  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
21068  {0, 0, 0, 0}
21069 };
21070 
21071 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
21072  PyVarObject_HEAD_INIT(0, 0)
21073  "csmoothers.cASMFactor", /*tp_name*/
21074  sizeof(struct __pyx_obj_10csmoothers_cASMFactor), /*tp_basicsize*/
21075  0, /*tp_itemsize*/
21076  __pyx_tp_dealloc_10csmoothers_cASMFactor, /*tp_dealloc*/
21077  #if PY_VERSION_HEX < 0x030800b4
21078  0, /*tp_print*/
21079  #endif
21080  #if PY_VERSION_HEX >= 0x030800b4
21081  0, /*tp_vectorcall_offset*/
21082  #endif
21083  0, /*tp_getattr*/
21084  0, /*tp_setattr*/
21085  #if PY_MAJOR_VERSION < 3
21086  0, /*tp_compare*/
21087  #endif
21088  #if PY_MAJOR_VERSION >= 3
21089  0, /*tp_as_async*/
21090  #endif
21091  0, /*tp_repr*/
21092  0, /*tp_as_number*/
21093  0, /*tp_as_sequence*/
21094  0, /*tp_as_mapping*/
21095  0, /*tp_hash*/
21096  0, /*tp_call*/
21097  0, /*tp_str*/
21098  0, /*tp_getattro*/
21099  0, /*tp_setattro*/
21100  0, /*tp_as_buffer*/
21101  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21102  0, /*tp_doc*/
21103  0, /*tp_traverse*/
21104  0, /*tp_clear*/
21105  0, /*tp_richcompare*/
21106  0, /*tp_weaklistoffset*/
21107  0, /*tp_iter*/
21108  0, /*tp_iternext*/
21109  __pyx_methods_10csmoothers_cASMFactor, /*tp_methods*/
21110  0, /*tp_members*/
21111  0, /*tp_getset*/
21112  0, /*tp_base*/
21113  0, /*tp_dict*/
21114  0, /*tp_descr_get*/
21115  0, /*tp_descr_set*/
21116  0, /*tp_dictoffset*/
21117  0, /*tp_init*/
21118  0, /*tp_alloc*/
21119  __pyx_tp_new_10csmoothers_cASMFactor, /*tp_new*/
21120  0, /*tp_free*/
21121  0, /*tp_is_gc*/
21122  0, /*tp_bases*/
21123  0, /*tp_mro*/
21124  0, /*tp_cache*/
21125  0, /*tp_subclasses*/
21126  0, /*tp_weaklist*/
21127  0, /*tp_del*/
21128  0, /*tp_version_tag*/
21129  #if PY_VERSION_HEX >= 0x030400a1
21130  0, /*tp_finalize*/
21131  #endif
21132  #if PY_VERSION_HEX >= 0x030800b1
21133  0, /*tp_vectorcall*/
21134  #endif
21135  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21136  0, /*tp_print*/
21137  #endif
21138 };
21139 
21140 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21141  PyObject *o;
21142  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21143  o = (*t->tp_alloc)(t, 0);
21144  } else {
21145  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21146  }
21147  if (unlikely(!o)) return 0;
21148  if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
21149  return o;
21150  bad:
21151  Py_DECREF(o); o = 0;
21152  return NULL;
21153 }
21154 
21155 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
21156  #if CYTHON_USE_TP_FINALIZE
21157  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21158  if (PyObject_CallFinalizerFromDealloc(o)) return;
21159  }
21160  #endif
21161  {
21162  PyObject *etype, *eval, *etb;
21163  PyErr_Fetch(&etype, &eval, &etb);
21164  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21165  __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
21166  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21167  PyErr_Restore(etype, eval, etb);
21168  }
21169  (*Py_TYPE(o)->tp_free)(o);
21170 }
21171 
21172 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
21173  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21174  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
21175  {0, 0, 0, 0}
21176 };
21177 
21178 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
21179  PyVarObject_HEAD_INIT(0, 0)
21180  "csmoothers.cBASMFactor", /*tp_name*/
21181  sizeof(struct __pyx_obj_10csmoothers_cBASMFactor), /*tp_basicsize*/
21182  0, /*tp_itemsize*/
21183  __pyx_tp_dealloc_10csmoothers_cBASMFactor, /*tp_dealloc*/
21184  #if PY_VERSION_HEX < 0x030800b4
21185  0, /*tp_print*/
21186  #endif
21187  #if PY_VERSION_HEX >= 0x030800b4
21188  0, /*tp_vectorcall_offset*/
21189  #endif
21190  0, /*tp_getattr*/
21191  0, /*tp_setattr*/
21192  #if PY_MAJOR_VERSION < 3
21193  0, /*tp_compare*/
21194  #endif
21195  #if PY_MAJOR_VERSION >= 3
21196  0, /*tp_as_async*/
21197  #endif
21198  0, /*tp_repr*/
21199  0, /*tp_as_number*/
21200  0, /*tp_as_sequence*/
21201  0, /*tp_as_mapping*/
21202  0, /*tp_hash*/
21203  0, /*tp_call*/
21204  0, /*tp_str*/
21205  0, /*tp_getattro*/
21206  0, /*tp_setattro*/
21207  0, /*tp_as_buffer*/
21208  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21209  0, /*tp_doc*/
21210  0, /*tp_traverse*/
21211  0, /*tp_clear*/
21212  0, /*tp_richcompare*/
21213  0, /*tp_weaklistoffset*/
21214  0, /*tp_iter*/
21215  0, /*tp_iternext*/
21216  __pyx_methods_10csmoothers_cBASMFactor, /*tp_methods*/
21217  0, /*tp_members*/
21218  0, /*tp_getset*/
21219  0, /*tp_base*/
21220  0, /*tp_dict*/
21221  0, /*tp_descr_get*/
21222  0, /*tp_descr_set*/
21223  0, /*tp_dictoffset*/
21224  0, /*tp_init*/
21225  0, /*tp_alloc*/
21226  __pyx_tp_new_10csmoothers_cBASMFactor, /*tp_new*/
21227  0, /*tp_free*/
21228  0, /*tp_is_gc*/
21229  0, /*tp_bases*/
21230  0, /*tp_mro*/
21231  0, /*tp_cache*/
21232  0, /*tp_subclasses*/
21233  0, /*tp_weaklist*/
21234  0, /*tp_del*/
21235  0, /*tp_version_tag*/
21236  #if PY_VERSION_HEX >= 0x030400a1
21237  0, /*tp_finalize*/
21238  #endif
21239  #if PY_VERSION_HEX >= 0x030800b1
21240  0, /*tp_vectorcall*/
21241  #endif
21242  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21243  0, /*tp_print*/
21244  #endif
21245 };
21246 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21247 
21248 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21249  struct __pyx_array_obj *p;
21250  PyObject *o;
21251  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21252  o = (*t->tp_alloc)(t, 0);
21253  } else {
21254  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21255  }
21256  if (unlikely(!o)) return 0;
21257  p = ((struct __pyx_array_obj *)o);
21258  p->__pyx_vtab = __pyx_vtabptr_array;
21259  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21260  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21261  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21262  return o;
21263  bad:
21264  Py_DECREF(o); o = 0;
21265  return NULL;
21266 }
21267 
21268 static void __pyx_tp_dealloc_array(PyObject *o) {
21269  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21270  #if CYTHON_USE_TP_FINALIZE
21271  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21272  if (PyObject_CallFinalizerFromDealloc(o)) return;
21273  }
21274  #endif
21275  {
21276  PyObject *etype, *eval, *etb;
21277  PyErr_Fetch(&etype, &eval, &etb);
21278  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21279  __pyx_array___dealloc__(o);
21280  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21281  PyErr_Restore(etype, eval, etb);
21282  }
21283  Py_CLEAR(p->mode);
21284  Py_CLEAR(p->_format);
21285  (*Py_TYPE(o)->tp_free)(o);
21286 }
21287 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21288  PyObject *r;
21289  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21290  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21291  Py_DECREF(x);
21292  return r;
21293 }
21294 
21295 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21296  if (v) {
21297  return __pyx_array___setitem__(o, i, v);
21298  }
21299  else {
21300  PyErr_Format(PyExc_NotImplementedError,
21301  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21302  return -1;
21303  }
21304 }
21305 
21306 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21307  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21308  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21309  PyErr_Clear();
21310  v = __pyx_array___getattr__(o, n);
21311  }
21312  return v;
21313 }
21314 
21315 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21316  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21317 }
21318 
21319 static PyMethodDef __pyx_methods_array[] = {
21320  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21321  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21322  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21323  {0, 0, 0, 0}
21324 };
21325 
21326 static struct PyGetSetDef __pyx_getsets_array[] = {
21327  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21328  {0, 0, 0, 0, 0}
21329 };
21330 
21331 static PySequenceMethods __pyx_tp_as_sequence_array = {
21332  __pyx_array___len__, /*sq_length*/
21333  0, /*sq_concat*/
21334  0, /*sq_repeat*/
21335  __pyx_sq_item_array, /*sq_item*/
21336  0, /*sq_slice*/
21337  0, /*sq_ass_item*/
21338  0, /*sq_ass_slice*/
21339  0, /*sq_contains*/
21340  0, /*sq_inplace_concat*/
21341  0, /*sq_inplace_repeat*/
21342 };
21343 
21344 static PyMappingMethods __pyx_tp_as_mapping_array = {
21345  __pyx_array___len__, /*mp_length*/
21346  __pyx_array___getitem__, /*mp_subscript*/
21347  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21348 };
21349 
21350 static PyBufferProcs __pyx_tp_as_buffer_array = {
21351  #if PY_MAJOR_VERSION < 3
21352  0, /*bf_getreadbuffer*/
21353  #endif
21354  #if PY_MAJOR_VERSION < 3
21355  0, /*bf_getwritebuffer*/
21356  #endif
21357  #if PY_MAJOR_VERSION < 3
21358  0, /*bf_getsegcount*/
21359  #endif
21360  #if PY_MAJOR_VERSION < 3
21361  0, /*bf_getcharbuffer*/
21362  #endif
21363  __pyx_array_getbuffer, /*bf_getbuffer*/
21364  0, /*bf_releasebuffer*/
21365 };
21366 
21367 static PyTypeObject __pyx_type___pyx_array = {
21368  PyVarObject_HEAD_INIT(0, 0)
21369  "csmoothers.array", /*tp_name*/
21370  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21371  0, /*tp_itemsize*/
21372  __pyx_tp_dealloc_array, /*tp_dealloc*/
21373  #if PY_VERSION_HEX < 0x030800b4
21374  0, /*tp_print*/
21375  #endif
21376  #if PY_VERSION_HEX >= 0x030800b4
21377  0, /*tp_vectorcall_offset*/
21378  #endif
21379  0, /*tp_getattr*/
21380  0, /*tp_setattr*/
21381  #if PY_MAJOR_VERSION < 3
21382  0, /*tp_compare*/
21383  #endif
21384  #if PY_MAJOR_VERSION >= 3
21385  0, /*tp_as_async*/
21386  #endif
21387  0, /*tp_repr*/
21388  0, /*tp_as_number*/
21389  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21390  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21391  0, /*tp_hash*/
21392  0, /*tp_call*/
21393  0, /*tp_str*/
21394  __pyx_tp_getattro_array, /*tp_getattro*/
21395  0, /*tp_setattro*/
21396  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21397  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21398  0, /*tp_doc*/
21399  0, /*tp_traverse*/
21400  0, /*tp_clear*/
21401  0, /*tp_richcompare*/
21402  0, /*tp_weaklistoffset*/
21403  0, /*tp_iter*/
21404  0, /*tp_iternext*/
21405  __pyx_methods_array, /*tp_methods*/
21406  0, /*tp_members*/
21407  __pyx_getsets_array, /*tp_getset*/
21408  0, /*tp_base*/
21409  0, /*tp_dict*/
21410  0, /*tp_descr_get*/
21411  0, /*tp_descr_set*/
21412  0, /*tp_dictoffset*/
21413  0, /*tp_init*/
21414  0, /*tp_alloc*/
21415  __pyx_tp_new_array, /*tp_new*/
21416  0, /*tp_free*/
21417  0, /*tp_is_gc*/
21418  0, /*tp_bases*/
21419  0, /*tp_mro*/
21420  0, /*tp_cache*/
21421  0, /*tp_subclasses*/
21422  0, /*tp_weaklist*/
21423  0, /*tp_del*/
21424  0, /*tp_version_tag*/
21425  #if PY_VERSION_HEX >= 0x030400a1
21426  0, /*tp_finalize*/
21427  #endif
21428  #if PY_VERSION_HEX >= 0x030800b1
21429  0, /*tp_vectorcall*/
21430  #endif
21431  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21432  0, /*tp_print*/
21433  #endif
21434 };
21435 
21436 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21437  struct __pyx_MemviewEnum_obj *p;
21438  PyObject *o;
21439  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21440  o = (*t->tp_alloc)(t, 0);
21441  } else {
21442  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21443  }
21444  if (unlikely(!o)) return 0;
21445  p = ((struct __pyx_MemviewEnum_obj *)o);
21446  p->name = Py_None; Py_INCREF(Py_None);
21447  return o;
21448 }
21449 
21450 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21451  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21452  #if CYTHON_USE_TP_FINALIZE
21453  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21454  if (PyObject_CallFinalizerFromDealloc(o)) return;
21455  }
21456  #endif
21457  PyObject_GC_UnTrack(o);
21458  Py_CLEAR(p->name);
21459  (*Py_TYPE(o)->tp_free)(o);
21460 }
21461 
21462 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21463  int e;
21464  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21465  if (p->name) {
21466  e = (*v)(p->name, a); if (e) return e;
21467  }
21468  return 0;
21469 }
21470 
21471 static int __pyx_tp_clear_Enum(PyObject *o) {
21472  PyObject* tmp;
21473  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21474  tmp = ((PyObject*)p->name);
21475  p->name = Py_None; Py_INCREF(Py_None);
21476  Py_XDECREF(tmp);
21477  return 0;
21478 }
21479 
21480 static PyMethodDef __pyx_methods_Enum[] = {
21481  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21482  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21483  {0, 0, 0, 0}
21484 };
21485 
21486 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21487  PyVarObject_HEAD_INIT(0, 0)
21488  "csmoothers.Enum", /*tp_name*/
21489  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21490  0, /*tp_itemsize*/
21491  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21492  #if PY_VERSION_HEX < 0x030800b4
21493  0, /*tp_print*/
21494  #endif
21495  #if PY_VERSION_HEX >= 0x030800b4
21496  0, /*tp_vectorcall_offset*/
21497  #endif
21498  0, /*tp_getattr*/
21499  0, /*tp_setattr*/
21500  #if PY_MAJOR_VERSION < 3
21501  0, /*tp_compare*/
21502  #endif
21503  #if PY_MAJOR_VERSION >= 3
21504  0, /*tp_as_async*/
21505  #endif
21506  __pyx_MemviewEnum___repr__, /*tp_repr*/
21507  0, /*tp_as_number*/
21508  0, /*tp_as_sequence*/
21509  0, /*tp_as_mapping*/
21510  0, /*tp_hash*/
21511  0, /*tp_call*/
21512  0, /*tp_str*/
21513  0, /*tp_getattro*/
21514  0, /*tp_setattro*/
21515  0, /*tp_as_buffer*/
21516  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21517  0, /*tp_doc*/
21518  __pyx_tp_traverse_Enum, /*tp_traverse*/
21519  __pyx_tp_clear_Enum, /*tp_clear*/
21520  0, /*tp_richcompare*/
21521  0, /*tp_weaklistoffset*/
21522  0, /*tp_iter*/
21523  0, /*tp_iternext*/
21524  __pyx_methods_Enum, /*tp_methods*/
21525  0, /*tp_members*/
21526  0, /*tp_getset*/
21527  0, /*tp_base*/
21528  0, /*tp_dict*/
21529  0, /*tp_descr_get*/
21530  0, /*tp_descr_set*/
21531  0, /*tp_dictoffset*/
21532  __pyx_MemviewEnum___init__, /*tp_init*/
21533  0, /*tp_alloc*/
21534  __pyx_tp_new_Enum, /*tp_new*/
21535  0, /*tp_free*/
21536  0, /*tp_is_gc*/
21537  0, /*tp_bases*/
21538  0, /*tp_mro*/
21539  0, /*tp_cache*/
21540  0, /*tp_subclasses*/
21541  0, /*tp_weaklist*/
21542  0, /*tp_del*/
21543  0, /*tp_version_tag*/
21544  #if PY_VERSION_HEX >= 0x030400a1
21545  0, /*tp_finalize*/
21546  #endif
21547  #if PY_VERSION_HEX >= 0x030800b1
21548  0, /*tp_vectorcall*/
21549  #endif
21550  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21551  0, /*tp_print*/
21552  #endif
21553 };
21554 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21555 
21556 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21557  struct __pyx_memoryview_obj *p;
21558  PyObject *o;
21559  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21560  o = (*t->tp_alloc)(t, 0);
21561  } else {
21562  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21563  }
21564  if (unlikely(!o)) return 0;
21565  p = ((struct __pyx_memoryview_obj *)o);
21566  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21567  p->obj = Py_None; Py_INCREF(Py_None);
21568  p->_size = Py_None; Py_INCREF(Py_None);
21569  p->_array_interface = Py_None; Py_INCREF(Py_None);
21570  p->view.obj = NULL;
21571  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21572  return o;
21573  bad:
21574  Py_DECREF(o); o = 0;
21575  return NULL;
21576 }
21577 
21578 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21579  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21580  #if CYTHON_USE_TP_FINALIZE
21581  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21582  if (PyObject_CallFinalizerFromDealloc(o)) return;
21583  }
21584  #endif
21585  PyObject_GC_UnTrack(o);
21586  {
21587  PyObject *etype, *eval, *etb;
21588  PyErr_Fetch(&etype, &eval, &etb);
21589  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21590  __pyx_memoryview___dealloc__(o);
21591  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21592  PyErr_Restore(etype, eval, etb);
21593  }
21594  Py_CLEAR(p->obj);
21595  Py_CLEAR(p->_size);
21596  Py_CLEAR(p->_array_interface);
21597  (*Py_TYPE(o)->tp_free)(o);
21598 }
21599 
21600 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21601  int e;
21602  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21603  if (p->obj) {
21604  e = (*v)(p->obj, a); if (e) return e;
21605  }
21606  if (p->_size) {
21607  e = (*v)(p->_size, a); if (e) return e;
21608  }
21609  if (p->_array_interface) {
21610  e = (*v)(p->_array_interface, a); if (e) return e;
21611  }
21612  if (p->view.obj) {
21613  e = (*v)(p->view.obj, a); if (e) return e;
21614  }
21615  return 0;
21616 }
21617 
21618 static int __pyx_tp_clear_memoryview(PyObject *o) {
21619  PyObject* tmp;
21620  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21621  tmp = ((PyObject*)p->obj);
21622  p->obj = Py_None; Py_INCREF(Py_None);
21623  Py_XDECREF(tmp);
21624  tmp = ((PyObject*)p->_size);
21625  p->_size = Py_None; Py_INCREF(Py_None);
21626  Py_XDECREF(tmp);
21627  tmp = ((PyObject*)p->_array_interface);
21628  p->_array_interface = Py_None; Py_INCREF(Py_None);
21629  Py_XDECREF(tmp);
21630  Py_CLEAR(p->view.obj);
21631  return 0;
21632 }
21633 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21634  PyObject *r;
21635  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21636  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21637  Py_DECREF(x);
21638  return r;
21639 }
21640 
21641 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21642  if (v) {
21643  return __pyx_memoryview___setitem__(o, i, v);
21644  }
21645  else {
21646  PyErr_Format(PyExc_NotImplementedError,
21647  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21648  return -1;
21649  }
21650 }
21651 
21652 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21653  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21654 }
21655 
21656 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21657  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21658 }
21659 
21660 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21661  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21662 }
21663 
21664 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21665  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21666 }
21667 
21668 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21669  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21670 }
21671 
21672 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21673  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21674 }
21675 
21676 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21677  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21678 }
21679 
21680 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21681  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21682 }
21683 
21684 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21685  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21686 }
21687 
21688 static PyMethodDef __pyx_methods_memoryview[] = {
21689  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21690  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21691  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21692  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21693  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21694  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21695  {0, 0, 0, 0}
21696 };
21697 
21698 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21699  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21700  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21701  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21702  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21703  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21704  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21705  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21706  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21707  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21708  {0, 0, 0, 0, 0}
21709 };
21710 
21711 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21712  __pyx_memoryview___len__, /*sq_length*/
21713  0, /*sq_concat*/
21714  0, /*sq_repeat*/
21715  __pyx_sq_item_memoryview, /*sq_item*/
21716  0, /*sq_slice*/
21717  0, /*sq_ass_item*/
21718  0, /*sq_ass_slice*/
21719  0, /*sq_contains*/
21720  0, /*sq_inplace_concat*/
21721  0, /*sq_inplace_repeat*/
21722 };
21723 
21724 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21725  __pyx_memoryview___len__, /*mp_length*/
21726  __pyx_memoryview___getitem__, /*mp_subscript*/
21727  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21728 };
21729 
21730 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21731  #if PY_MAJOR_VERSION < 3
21732  0, /*bf_getreadbuffer*/
21733  #endif
21734  #if PY_MAJOR_VERSION < 3
21735  0, /*bf_getwritebuffer*/
21736  #endif
21737  #if PY_MAJOR_VERSION < 3
21738  0, /*bf_getsegcount*/
21739  #endif
21740  #if PY_MAJOR_VERSION < 3
21741  0, /*bf_getcharbuffer*/
21742  #endif
21743  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21744  0, /*bf_releasebuffer*/
21745 };
21746 
21747 static PyTypeObject __pyx_type___pyx_memoryview = {
21748  PyVarObject_HEAD_INIT(0, 0)
21749  "csmoothers.memoryview", /*tp_name*/
21750  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21751  0, /*tp_itemsize*/
21752  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21753  #if PY_VERSION_HEX < 0x030800b4
21754  0, /*tp_print*/
21755  #endif
21756  #if PY_VERSION_HEX >= 0x030800b4
21757  0, /*tp_vectorcall_offset*/
21758  #endif
21759  0, /*tp_getattr*/
21760  0, /*tp_setattr*/
21761  #if PY_MAJOR_VERSION < 3
21762  0, /*tp_compare*/
21763  #endif
21764  #if PY_MAJOR_VERSION >= 3
21765  0, /*tp_as_async*/
21766  #endif
21767  __pyx_memoryview___repr__, /*tp_repr*/
21768  0, /*tp_as_number*/
21769  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21770  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21771  0, /*tp_hash*/
21772  0, /*tp_call*/
21773  __pyx_memoryview___str__, /*tp_str*/
21774  0, /*tp_getattro*/
21775  0, /*tp_setattro*/
21776  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21777  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21778  0, /*tp_doc*/
21779  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21780  __pyx_tp_clear_memoryview, /*tp_clear*/
21781  0, /*tp_richcompare*/
21782  0, /*tp_weaklistoffset*/
21783  0, /*tp_iter*/
21784  0, /*tp_iternext*/
21785  __pyx_methods_memoryview, /*tp_methods*/
21786  0, /*tp_members*/
21787  __pyx_getsets_memoryview, /*tp_getset*/
21788  0, /*tp_base*/
21789  0, /*tp_dict*/
21790  0, /*tp_descr_get*/
21791  0, /*tp_descr_set*/
21792  0, /*tp_dictoffset*/
21793  0, /*tp_init*/
21794  0, /*tp_alloc*/
21795  __pyx_tp_new_memoryview, /*tp_new*/
21796  0, /*tp_free*/
21797  0, /*tp_is_gc*/
21798  0, /*tp_bases*/
21799  0, /*tp_mro*/
21800  0, /*tp_cache*/
21801  0, /*tp_subclasses*/
21802  0, /*tp_weaklist*/
21803  0, /*tp_del*/
21804  0, /*tp_version_tag*/
21805  #if PY_VERSION_HEX >= 0x030400a1
21806  0, /*tp_finalize*/
21807  #endif
21808  #if PY_VERSION_HEX >= 0x030800b1
21809  0, /*tp_vectorcall*/
21810  #endif
21811  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21812  0, /*tp_print*/
21813  #endif
21814 };
21815 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21816 
21817 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21818  struct __pyx_memoryviewslice_obj *p;
21819  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21820  if (unlikely(!o)) return 0;
21821  p = ((struct __pyx_memoryviewslice_obj *)o);
21822  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21823  p->from_object = Py_None; Py_INCREF(Py_None);
21824  p->from_slice.memview = NULL;
21825  return o;
21826 }
21827 
21828 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21829  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21830  #if CYTHON_USE_TP_FINALIZE
21831  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21832  if (PyObject_CallFinalizerFromDealloc(o)) return;
21833  }
21834  #endif
21835  PyObject_GC_UnTrack(o);
21836  {
21837  PyObject *etype, *eval, *etb;
21838  PyErr_Fetch(&etype, &eval, &etb);
21839  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21840  __pyx_memoryviewslice___dealloc__(o);
21841  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21842  PyErr_Restore(etype, eval, etb);
21843  }
21844  Py_CLEAR(p->from_object);
21845  PyObject_GC_Track(o);
21846  __pyx_tp_dealloc_memoryview(o);
21847 }
21848 
21849 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21850  int e;
21851  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21852  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21853  if (p->from_object) {
21854  e = (*v)(p->from_object, a); if (e) return e;
21855  }
21856  return 0;
21857 }
21858 
21859 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21860  PyObject* tmp;
21861  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21862  __pyx_tp_clear_memoryview(o);
21863  tmp = ((PyObject*)p->from_object);
21864  p->from_object = Py_None; Py_INCREF(Py_None);
21865  Py_XDECREF(tmp);
21866  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21867  return 0;
21868 }
21869 
21870 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21871  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21872 }
21873 
21874 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21875  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21876  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21877  {0, 0, 0, 0}
21878 };
21879 
21880 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21881  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21882  {0, 0, 0, 0, 0}
21883 };
21884 
21885 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21886  PyVarObject_HEAD_INIT(0, 0)
21887  "csmoothers._memoryviewslice", /*tp_name*/
21888  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21889  0, /*tp_itemsize*/
21890  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21891  #if PY_VERSION_HEX < 0x030800b4
21892  0, /*tp_print*/
21893  #endif
21894  #if PY_VERSION_HEX >= 0x030800b4
21895  0, /*tp_vectorcall_offset*/
21896  #endif
21897  0, /*tp_getattr*/
21898  0, /*tp_setattr*/
21899  #if PY_MAJOR_VERSION < 3
21900  0, /*tp_compare*/
21901  #endif
21902  #if PY_MAJOR_VERSION >= 3
21903  0, /*tp_as_async*/
21904  #endif
21905  #if CYTHON_COMPILING_IN_PYPY
21906  __pyx_memoryview___repr__, /*tp_repr*/
21907  #else
21908  0, /*tp_repr*/
21909  #endif
21910  0, /*tp_as_number*/
21911  0, /*tp_as_sequence*/
21912  0, /*tp_as_mapping*/
21913  0, /*tp_hash*/
21914  0, /*tp_call*/
21915  #if CYTHON_COMPILING_IN_PYPY
21916  __pyx_memoryview___str__, /*tp_str*/
21917  #else
21918  0, /*tp_str*/
21919  #endif
21920  0, /*tp_getattro*/
21921  0, /*tp_setattro*/
21922  0, /*tp_as_buffer*/
21923  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21924  "Internal class for passing memoryview slices to Python", /*tp_doc*/
21925  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21926  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21927  0, /*tp_richcompare*/
21928  0, /*tp_weaklistoffset*/
21929  0, /*tp_iter*/
21930  0, /*tp_iternext*/
21931  __pyx_methods__memoryviewslice, /*tp_methods*/
21932  0, /*tp_members*/
21933  __pyx_getsets__memoryviewslice, /*tp_getset*/
21934  0, /*tp_base*/
21935  0, /*tp_dict*/
21936  0, /*tp_descr_get*/
21937  0, /*tp_descr_set*/
21938  0, /*tp_dictoffset*/
21939  0, /*tp_init*/
21940  0, /*tp_alloc*/
21941  __pyx_tp_new__memoryviewslice, /*tp_new*/
21942  0, /*tp_free*/
21943  0, /*tp_is_gc*/
21944  0, /*tp_bases*/
21945  0, /*tp_mro*/
21946  0, /*tp_cache*/
21947  0, /*tp_subclasses*/
21948  0, /*tp_weaklist*/
21949  0, /*tp_del*/
21950  0, /*tp_version_tag*/
21951  #if PY_VERSION_HEX >= 0x030400a1
21952  0, /*tp_finalize*/
21953  #endif
21954  #if PY_VERSION_HEX >= 0x030800b1
21955  0, /*tp_vectorcall*/
21956  #endif
21957  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21958  0, /*tp_print*/
21959  #endif
21960 };
21961 
21962 static PyMethodDef __pyx_methods[] = {
21963  {0, 0, 0, 0}
21964 };
21965 
21966 #if PY_MAJOR_VERSION >= 3
21967 #if CYTHON_PEP489_MULTI_PHASE_INIT
21968 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
21969 static int __pyx_pymod_exec_csmoothers(PyObject* module); /*proto*/
21970 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21971  {Py_mod_create, (void*)__pyx_pymod_create},
21972  {Py_mod_exec, (void*)__pyx_pymod_exec_csmoothers},
21973  {0, NULL}
21974 };
21975 #endif
21976 
21977 static struct PyModuleDef __pyx_moduledef = {
21978  PyModuleDef_HEAD_INIT,
21979  "csmoothers",
21980  0, /* m_doc */
21981  #if CYTHON_PEP489_MULTI_PHASE_INIT
21982  0, /* m_size */
21983  #else
21984  -1, /* m_size */
21985  #endif
21986  __pyx_methods /* m_methods */,
21987  #if CYTHON_PEP489_MULTI_PHASE_INIT
21988  __pyx_moduledef_slots, /* m_slots */
21989  #else
21990  NULL, /* m_reload */
21991  #endif
21992  NULL, /* m_traverse */
21993  NULL, /* m_clear */
21994  NULL /* m_free */
21995 };
21996 #endif
21997 #ifndef CYTHON_SMALL_CODE
21998 #if defined(__clang__)
21999  #define CYTHON_SMALL_CODE
22000 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22001  #define CYTHON_SMALL_CODE __attribute__((cold))
22002 #else
22003  #define CYTHON_SMALL_CODE
22004 #endif
22005 #endif
22006 
22007 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22008  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
22009  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22010  {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor, sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
22011  {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init, sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
22012  {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor, sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
22013  {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init, sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
22014  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22015  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22016  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22017  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22018  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22019  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22020  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22021  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22022  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22023  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22024  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22025  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22026  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22027  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
22028  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
22029  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22030  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22031  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22032  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22033  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22034  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22035  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
22036  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22037  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22038  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22039  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22040  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22041  {&__pyx_n_s_asmFactor, __pyx_k_asmFactor, sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
22042  {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare, sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
22043  {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve, sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
22044  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22045  {&__pyx_n_s_basmFactor, __pyx_k_basmFactor, sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
22046  {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare, sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
22047  {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve, sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
22048  {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1},
22049  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22050  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22051  {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor, sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
22052  {&__pyx_n_s_cASMFactor_2, __pyx_k_cASMFactor_2, sizeof(__pyx_k_cASMFactor_2), 0, 0, 1, 1},
22053  {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor, sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
22054  {&__pyx_n_s_cBASMFactor_2, __pyx_k_cBASMFactor_2, sizeof(__pyx_k_cBASMFactor_2), 0, 0, 1, 1},
22055  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22056  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22057  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22058  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22059  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22060  {&__pyx_n_s_csmoothers, __pyx_k_csmoothers, sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
22061  {&__pyx_n_s_dX, __pyx_k_dX, sizeof(__pyx_k_dX), 0, 0, 1, 1},
22062  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22063  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
22064  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22065  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22066  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22067  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22068  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22069  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22070  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22071  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22072  {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare, sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
22073  {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve, sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
22074  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22075  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22076  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22077  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22078  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
22079  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22080  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22081  {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare, sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
22082  {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve, sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
22083  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22084  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22085  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22086  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22087  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
22088  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22089  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22090  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
22091  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22092  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22093  {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve, sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
22094  {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve, sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
22095  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22096  {&__pyx_n_s_node_order, __pyx_k_node_order, sizeof(__pyx_k_node_order), 0, 0, 1, 1},
22097  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22098  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
22099  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22100  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22101  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22102  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22103  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
22104  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22105  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22106  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22107  {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx, sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
22108  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22109  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22110  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22111  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22112  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22113  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22114  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22115  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22116  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22117  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22118  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22119  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22120  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22121  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22122  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22123  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22124  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22125  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22126  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22127  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22128  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22129  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22130  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22131  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22132  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22133  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22134  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22135  {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1},
22136  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22137  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22138  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22139  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22140  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
22141  {0, 0, 0, 0, 0, 0, 0}
22142 };
22143 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22144  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
22145  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22146  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
22147  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
22148  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22149  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22150  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22151  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22152  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22153  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22154  return 0;
22155  __pyx_L1_error:;
22156  return -1;
22157 }
22158 
22159 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22160  __Pyx_RefNannyDeclarations
22161  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22162 
22163  /* "(tree fragment)":2
22164  * def __reduce_cython__(self):
22165  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22166  * def __setstate_cython__(self, __pyx_state):
22167  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22168  */
22169  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
22170  __Pyx_GOTREF(__pyx_tuple_);
22171  __Pyx_GIVEREF(__pyx_tuple_);
22172 
22173  /* "(tree fragment)":4
22174  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22175  * def __setstate_cython__(self, __pyx_state):
22176  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22177  */
22178  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
22179  __Pyx_GOTREF(__pyx_tuple__2);
22180  __Pyx_GIVEREF(__pyx_tuple__2);
22181 
22182  /* "(tree fragment)":2
22183  * def __reduce_cython__(self):
22184  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22185  * def __setstate_cython__(self, __pyx_state):
22186  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22187  */
22188  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
22189  __Pyx_GOTREF(__pyx_tuple__3);
22190  __Pyx_GIVEREF(__pyx_tuple__3);
22191 
22192  /* "(tree fragment)":4
22193  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22194  * def __setstate_cython__(self, __pyx_state):
22195  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22196  */
22197  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
22198  __Pyx_GOTREF(__pyx_tuple__4);
22199  __Pyx_GIVEREF(__pyx_tuple__4);
22200 
22201  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":945
22202  * __pyx_import_array()
22203  * except Exception:
22204  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22205  *
22206  * cdef inline int import_umath() except -1:
22207  */
22208  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 945, __pyx_L1_error)
22209  __Pyx_GOTREF(__pyx_tuple__5);
22210  __Pyx_GIVEREF(__pyx_tuple__5);
22211 
22212  /* "../miniconda3/envs/proteus-dev/lib/python3.9/site-packages/numpy/__init__.pxd":951
22213  * _import_umath()
22214  * except Exception:
22215  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22216  *
22217  * cdef inline int import_ufunc() except -1:
22218  */
22219  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 951, __pyx_L1_error)
22220  __Pyx_GOTREF(__pyx_tuple__6);
22221  __Pyx_GIVEREF(__pyx_tuple__6);
22222 
22223  /* "View.MemoryView":133
22224  *
22225  * if not self.ndim:
22226  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22227  *
22228  * if itemsize <= 0:
22229  */
22230  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 133, __pyx_L1_error)
22231  __Pyx_GOTREF(__pyx_tuple__7);
22232  __Pyx_GIVEREF(__pyx_tuple__7);
22233 
22234  /* "View.MemoryView":136
22235  *
22236  * if itemsize <= 0:
22237  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22238  *
22239  * if not isinstance(format, bytes):
22240  */
22241  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 136, __pyx_L1_error)
22242  __Pyx_GOTREF(__pyx_tuple__8);
22243  __Pyx_GIVEREF(__pyx_tuple__8);
22244 
22245  /* "View.MemoryView":148
22246  *
22247  * if not self._shape:
22248  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22249  *
22250  *
22251  */
22252  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 148, __pyx_L1_error)
22253  __Pyx_GOTREF(__pyx_tuple__9);
22254  __Pyx_GIVEREF(__pyx_tuple__9);
22255 
22256  /* "View.MemoryView":176
22257  * self.data = <char *>malloc(self.len)
22258  * if not self.data:
22259  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22260  *
22261  * if self.dtype_is_object:
22262  */
22263  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 176, __pyx_L1_error)
22264  __Pyx_GOTREF(__pyx_tuple__10);
22265  __Pyx_GIVEREF(__pyx_tuple__10);
22266 
22267  /* "View.MemoryView":192
22268  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22269  * if not (flags & bufmode):
22270  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22271  * info.buf = self.data
22272  * info.len = self.len
22273  */
22274  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 192, __pyx_L1_error)
22275  __Pyx_GOTREF(__pyx_tuple__11);
22276  __Pyx_GIVEREF(__pyx_tuple__11);
22277 
22278  /* "(tree fragment)":2
22279  * def __reduce_cython__(self):
22280  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22281  * def __setstate_cython__(self, __pyx_state):
22282  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22283  */
22284  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error)
22285  __Pyx_GOTREF(__pyx_tuple__12);
22286  __Pyx_GIVEREF(__pyx_tuple__12);
22287 
22288  /* "(tree fragment)":4
22289  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22290  * def __setstate_cython__(self, __pyx_state):
22291  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22292  */
22293  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
22294  __Pyx_GOTREF(__pyx_tuple__13);
22295  __Pyx_GIVEREF(__pyx_tuple__13);
22296 
22297  /* "View.MemoryView":418
22298  * def __setitem__(memoryview self, object index, object value):
22299  * if self.view.readonly:
22300  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22301  *
22302  * have_slices, index = _unellipsify(index, self.view.ndim)
22303  */
22304  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 418, __pyx_L1_error)
22305  __Pyx_GOTREF(__pyx_tuple__14);
22306  __Pyx_GIVEREF(__pyx_tuple__14);
22307 
22308  /* "View.MemoryView":495
22309  * result = struct.unpack(self.view.format, bytesitem)
22310  * except struct.error:
22311  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22312  * else:
22313  * if len(self.view.format) == 1:
22314  */
22315  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 495, __pyx_L1_error)
22316  __Pyx_GOTREF(__pyx_tuple__15);
22317  __Pyx_GIVEREF(__pyx_tuple__15);
22318 
22319  /* "View.MemoryView":520
22320  * def __getbuffer__(self, Py_buffer *info, int flags):
22321  * if flags & PyBUF_WRITABLE and self.view.readonly:
22322  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22323  *
22324  * if flags & PyBUF_ND:
22325  */
22326  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 520, __pyx_L1_error)
22327  __Pyx_GOTREF(__pyx_tuple__16);
22328  __Pyx_GIVEREF(__pyx_tuple__16);
22329 
22330  /* "View.MemoryView":570
22331  * if self.view.strides == NULL:
22332  *
22333  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22334  *
22335  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22336  */
22337  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 570, __pyx_L1_error)
22338  __Pyx_GOTREF(__pyx_tuple__17);
22339  __Pyx_GIVEREF(__pyx_tuple__17);
22340 
22341  /* "View.MemoryView":577
22342  * def suboffsets(self):
22343  * if self.view.suboffsets == NULL:
22344  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22345  *
22346  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22347  */
22348  __pyx_tuple__18 = PyTuple_New(1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 577, __pyx_L1_error)
22349  __Pyx_GOTREF(__pyx_tuple__18);
22350  __Pyx_INCREF(__pyx_int_neg_1);
22351  __Pyx_GIVEREF(__pyx_int_neg_1);
22352  PyTuple_SET_ITEM(__pyx_tuple__18, 0, __pyx_int_neg_1);
22353  __Pyx_GIVEREF(__pyx_tuple__18);
22354 
22355  /* "(tree fragment)":2
22356  * def __reduce_cython__(self):
22357  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22358  * def __setstate_cython__(self, __pyx_state):
22359  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22360  */
22361  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
22362  __Pyx_GOTREF(__pyx_tuple__19);
22363  __Pyx_GIVEREF(__pyx_tuple__19);
22364 
22365  /* "(tree fragment)":4
22366  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22367  * def __setstate_cython__(self, __pyx_state):
22368  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22369  */
22370  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error)
22371  __Pyx_GOTREF(__pyx_tuple__20);
22372  __Pyx_GIVEREF(__pyx_tuple__20);
22373 
22374  /* "View.MemoryView":682
22375  * if item is Ellipsis:
22376  * if not seen_ellipsis:
22377  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22378  * seen_ellipsis = True
22379  * else:
22380  */
22381  __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(1, 682, __pyx_L1_error)
22382  __Pyx_GOTREF(__pyx_slice__21);
22383  __Pyx_GIVEREF(__pyx_slice__21);
22384 
22385  /* "View.MemoryView":703
22386  * for suboffset in suboffsets[:ndim]:
22387  * if suboffset >= 0:
22388  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22389  *
22390  *
22391  */
22392  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 703, __pyx_L1_error)
22393  __Pyx_GOTREF(__pyx_tuple__22);
22394  __Pyx_GIVEREF(__pyx_tuple__22);
22395 
22396  /* "(tree fragment)":2
22397  * def __reduce_cython__(self):
22398  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22399  * def __setstate_cython__(self, __pyx_state):
22400  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22401  */
22402  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22403  __Pyx_GOTREF(__pyx_tuple__23);
22404  __Pyx_GIVEREF(__pyx_tuple__23);
22405 
22406  /* "(tree fragment)":4
22407  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22408  * def __setstate_cython__(self, __pyx_state):
22409  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22410  */
22411  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22412  __Pyx_GOTREF(__pyx_tuple__24);
22413  __Pyx_GIVEREF(__pyx_tuple__24);
22414 
22415  /* "csmoothers.pyx":5
22416  * cimport numpy as np
22417  *
22418  * class ASMFactor(object): # <<<<<<<<<<<<<<
22419  *
22420  * def __init__(self, L):
22421  */
22422  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 5, __pyx_L1_error)
22423  __Pyx_GOTREF(__pyx_tuple__25);
22424  __Pyx_GIVEREF(__pyx_tuple__25);
22425 
22426  /* "csmoothers.pyx":7
22427  * class ASMFactor(object):
22428  *
22429  * def __init__(self, L): # <<<<<<<<<<<<<<
22430  * self.L = L
22431  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
22432  */
22433  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 7, __pyx_L1_error)
22434  __Pyx_GOTREF(__pyx_tuple__26);
22435  __Pyx_GIVEREF(__pyx_tuple__26);
22436  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 7, __pyx_L1_error)
22437 
22438  /* "csmoothers.pyx":42
22439  *
22440  *
22441  * class BASMFactor(object): # <<<<<<<<<<<<<<
22442  *
22443  * def __init__(self, L, bs):
22444  */
22445  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 42, __pyx_L1_error)
22446  __Pyx_GOTREF(__pyx_tuple__28);
22447  __Pyx_GIVEREF(__pyx_tuple__28);
22448 
22449  /* "csmoothers.pyx":44
22450  * class BASMFactor(object):
22451  *
22452  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
22453  * self.L = L
22454  * self.bs = bs
22455  */
22456  __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 44, __pyx_L1_error)
22457  __Pyx_GOTREF(__pyx_tuple__29);
22458  __Pyx_GIVEREF(__pyx_tuple__29);
22459  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 44, __pyx_L1_error)
22460 
22461  /* "csmoothers.pyx":84
22462  * self.subdomain_col_pivots)
22463  *
22464  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
22465  * """
22466  *
22467  */
22468  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 84, __pyx_L1_error)
22469  __Pyx_GOTREF(__pyx_tuple__31);
22470  __Pyx_GIVEREF(__pyx_tuple__31);
22471  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 84, __pyx_L1_error)
22472 
22473  /* "csmoothers.pyx":109
22474  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
22475  *
22476  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
22477  * """
22478  *
22479  */
22480  __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 109, __pyx_L1_error)
22481  __Pyx_GOTREF(__pyx_tuple__33);
22482  __Pyx_GIVEREF(__pyx_tuple__33);
22483  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 109, __pyx_L1_error)
22484 
22485  /* "csmoothers.pyx":136
22486  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
22487  *
22488  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
22489  * """
22490  *
22491  */
22492  __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 136, __pyx_L1_error)
22493  __Pyx_GOTREF(__pyx_tuple__35);
22494  __Pyx_GIVEREF(__pyx_tuple__35);
22495  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 136, __pyx_L1_error)
22496 
22497  /* "csmoothers.pyx":165
22498  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
22499  *
22500  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
22501  * """
22502  *
22503  */
22504  __pyx_tuple__37 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 165, __pyx_L1_error)
22505  __Pyx_GOTREF(__pyx_tuple__37);
22506  __Pyx_GIVEREF(__pyx_tuple__37);
22507  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 165, __pyx_L1_error)
22508 
22509  /* "csmoothers.pyx":190
22510  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
22511  *
22512  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
22513  * """
22514  *
22515  */
22516  __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 190, __pyx_L1_error)
22517  __Pyx_GOTREF(__pyx_tuple__39);
22518  __Pyx_GIVEREF(__pyx_tuple__39);
22519  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 190, __pyx_L1_error)
22520 
22521  /* "csmoothers.pyx":217
22522  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
22523  *
22524  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
22525  * """
22526  *
22527  */
22528  __pyx_tuple__41 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 217, __pyx_L1_error)
22529  __Pyx_GOTREF(__pyx_tuple__41);
22530  __Pyx_GIVEREF(__pyx_tuple__41);
22531  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 217, __pyx_L1_error)
22532 
22533  /* "csmoothers.pyx":251
22534  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
22535  *
22536  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
22537  * """
22538  *
22539  */
22540  __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 251, __pyx_L1_error)
22541  __Pyx_GOTREF(__pyx_tuple__43);
22542  __Pyx_GIVEREF(__pyx_tuple__43);
22543  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 251, __pyx_L1_error)
22544 
22545  /* "csmoothers.pyx":277
22546  * asmFactor.subdomain_pivots)
22547  *
22548  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
22549  * """
22550  *
22551  */
22552  __pyx_tuple__45 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 277, __pyx_L1_error)
22553  __Pyx_GOTREF(__pyx_tuple__45);
22554  __Pyx_GIVEREF(__pyx_tuple__45);
22555  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 277, __pyx_L1_error)
22556 
22557  /* "csmoothers.pyx":321
22558  * asmFactor.subdomain_pivots)
22559  *
22560  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
22561  * """
22562  *
22563  */
22564  __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 321, __pyx_L1_error)
22565  __Pyx_GOTREF(__pyx_tuple__47);
22566  __Pyx_GIVEREF(__pyx_tuple__47);
22567  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 321, __pyx_L1_error)
22568 
22569  /* "csmoothers.pyx":350
22570  *
22571  *
22572  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
22573  * """
22574  *
22575  */
22576  __pyx_tuple__49 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 350, __pyx_L1_error)
22577  __Pyx_GOTREF(__pyx_tuple__49);
22578  __Pyx_GIVEREF(__pyx_tuple__49);
22579  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 350, __pyx_L1_error)
22580 
22581  /* "View.MemoryView":286
22582  * return self.name
22583  *
22584  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22585  * cdef strided = Enum("<strided and direct>") # default
22586  * cdef indirect = Enum("<strided and indirect>")
22587  */
22588  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 286, __pyx_L1_error)
22589  __Pyx_GOTREF(__pyx_tuple__51);
22590  __Pyx_GIVEREF(__pyx_tuple__51);
22591 
22592  /* "View.MemoryView":287
22593  *
22594  * cdef generic = Enum("<strided and direct or indirect>")
22595  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22596  * cdef indirect = Enum("<strided and indirect>")
22597  *
22598  */
22599  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 287, __pyx_L1_error)
22600  __Pyx_GOTREF(__pyx_tuple__52);
22601  __Pyx_GIVEREF(__pyx_tuple__52);
22602 
22603  /* "View.MemoryView":288
22604  * cdef generic = Enum("<strided and direct or indirect>")
22605  * cdef strided = Enum("<strided and direct>") # default
22606  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22607  *
22608  *
22609  */
22610  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 288, __pyx_L1_error)
22611  __Pyx_GOTREF(__pyx_tuple__53);
22612  __Pyx_GIVEREF(__pyx_tuple__53);
22613 
22614  /* "View.MemoryView":291
22615  *
22616  *
22617  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22618  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22619  *
22620  */
22621  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 291, __pyx_L1_error)
22622  __Pyx_GOTREF(__pyx_tuple__54);
22623  __Pyx_GIVEREF(__pyx_tuple__54);
22624 
22625  /* "View.MemoryView":292
22626  *
22627  * cdef contiguous = Enum("<contiguous and direct>")
22628  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22629  *
22630  *
22631  */
22632  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 292, __pyx_L1_error)
22633  __Pyx_GOTREF(__pyx_tuple__55);
22634  __Pyx_GIVEREF(__pyx_tuple__55);
22635 
22636  /* "(tree fragment)":1
22637  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22638  * cdef object __pyx_PickleError
22639  * cdef object __pyx_result
22640  */
22641  __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 1, __pyx_L1_error)
22642  __Pyx_GOTREF(__pyx_tuple__56);
22643  __Pyx_GIVEREF(__pyx_tuple__56);
22644  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 1, __pyx_L1_error)
22645  __Pyx_RefNannyFinishContext();
22646  return 0;
22647  __pyx_L1_error:;
22648  __Pyx_RefNannyFinishContext();
22649  return -1;
22650 }
22651 
22652 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22653  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22654  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22655  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22656  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22657  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22658  return 0;
22659  __pyx_L1_error:;
22660  return -1;
22661 }
22662 
22663 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22664 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22665 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22666 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22667 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22668 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22669 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22670 
22671 static int __Pyx_modinit_global_init_code(void) {
22672  __Pyx_RefNannyDeclarations
22673  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22674  /*--- Global init code ---*/
22675  generic = Py_None; Py_INCREF(Py_None);
22676  strided = Py_None; Py_INCREF(Py_None);
22677  indirect = Py_None; Py_INCREF(Py_None);
22678  contiguous = Py_None; Py_INCREF(Py_None);
22679  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22680  __Pyx_RefNannyFinishContext();
22681  return 0;
22682 }
22683 
22684 static int __Pyx_modinit_variable_export_code(void) {
22685  __Pyx_RefNannyDeclarations
22686  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22687  /*--- Variable export code ---*/
22688  __Pyx_RefNannyFinishContext();
22689  return 0;
22690 }
22691 
22692 static int __Pyx_modinit_function_export_code(void) {
22693  __Pyx_RefNannyDeclarations
22694  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22695  /*--- Function export code ---*/
22696  __Pyx_RefNannyFinishContext();
22697  return 0;
22698 }
22699 
22700 static int __Pyx_modinit_type_init_code(void) {
22701  __Pyx_RefNannyDeclarations
22702  int __pyx_lineno = 0;
22703  const char *__pyx_filename = NULL;
22704  int __pyx_clineno = 0;
22705  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22706  /*--- Type init code ---*/
22707  if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22708  #if PY_VERSION_HEX < 0x030800B1
22709  __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
22710  #endif
22711  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
22712  __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22713  }
22714  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22715  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22716  __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
22717  if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22718  #if PY_VERSION_HEX < 0x030800B1
22719  __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
22720  #endif
22721  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
22722  __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22723  }
22724  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cBASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22725  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22726  __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
22727  __pyx_vtabptr_array = &__pyx_vtable_array;
22728  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22729  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22730  #if PY_VERSION_HEX < 0x030800B1
22731  __pyx_type___pyx_array.tp_print = 0;
22732  #endif
22733  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22734  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22735  __pyx_array_type = &__pyx_type___pyx_array;
22736  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22737  #if PY_VERSION_HEX < 0x030800B1
22738  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22739  #endif
22740  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22741  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22742  }
22743  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22744  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22745  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22746  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22747  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22748  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22749  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22750  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22751  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22752  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22753  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22754  #if PY_VERSION_HEX < 0x030800B1
22755  __pyx_type___pyx_memoryview.tp_print = 0;
22756  #endif
22757  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22758  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22759  }
22760  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22761  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22762  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22763  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22764  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22765  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22766  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22767  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22768  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22769  #if PY_VERSION_HEX < 0x030800B1
22770  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22771  #endif
22772  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22773  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22774  }
22775  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22776  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22777  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22778  __Pyx_RefNannyFinishContext();
22779  return 0;
22780  __pyx_L1_error:;
22781  __Pyx_RefNannyFinishContext();
22782  return -1;
22783 }
22784 
22785 static int __Pyx_modinit_type_import_code(void) {
22786  __Pyx_RefNannyDeclarations
22787  PyObject *__pyx_t_1 = NULL;
22788  int __pyx_lineno = 0;
22789  const char *__pyx_filename = NULL;
22790  int __pyx_clineno = 0;
22791  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22792  /*--- Type import code ---*/
22793  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
22794  __Pyx_GOTREF(__pyx_t_1);
22795  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
22796  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22797  sizeof(PyTypeObject),
22798  #else
22799  sizeof(PyHeapTypeObject),
22800  #endif
22801  __Pyx_ImportType_CheckSize_Warn);
22802  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
22803  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22804  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
22805  __Pyx_GOTREF(__pyx_t_1);
22806  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
22807  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
22808  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
22809  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
22810  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
22811  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
22812  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
22813  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
22814  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22815  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
22816  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22817  if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
22818  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22819  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
22820  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22821  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
22822  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22823  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
22824  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22825  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
22826  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22827  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
22828  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22829  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
22830  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22831  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
22832  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22833  if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
22834  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
22835  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
22836  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22837  __pyx_t_1 = PyImport_ImportModule("proteus.superluWrappers"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
22838  __Pyx_GOTREF(__pyx_t_1);
22839  __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(__pyx_t_1, "proteus.superluWrappers", "cSparseMatrix", sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __Pyx_ImportType_CheckSize_Warn);
22840  if (!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 67, __pyx_L1_error)
22841  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22842  __Pyx_RefNannyFinishContext();
22843  return 0;
22844  __pyx_L1_error:;
22845  __Pyx_XDECREF(__pyx_t_1);
22846  __Pyx_RefNannyFinishContext();
22847  return -1;
22848 }
22849 
22850 static int __Pyx_modinit_variable_import_code(void) {
22851  __Pyx_RefNannyDeclarations
22852  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22853  /*--- Variable import code ---*/
22854  __Pyx_RefNannyFinishContext();
22855  return 0;
22856 }
22857 
22858 static int __Pyx_modinit_function_import_code(void) {
22859  __Pyx_RefNannyDeclarations
22860  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22861  /*--- Function import code ---*/
22862  __Pyx_RefNannyFinishContext();
22863  return 0;
22864 }
22865 
22866 
22867 #ifndef CYTHON_NO_PYINIT_EXPORT
22868 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22869 #elif PY_MAJOR_VERSION < 3
22870 #ifdef __cplusplus
22871 #define __Pyx_PyMODINIT_FUNC extern "C" void
22872 #else
22873 #define __Pyx_PyMODINIT_FUNC void
22874 #endif
22875 #else
22876 #ifdef __cplusplus
22877 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22878 #else
22879 #define __Pyx_PyMODINIT_FUNC PyObject *
22880 #endif
22881 #endif
22882 
22883 
22884 #if PY_MAJOR_VERSION < 3
22885 __Pyx_PyMODINIT_FUNC initcsmoothers(void) CYTHON_SMALL_CODE; /*proto*/
22886 __Pyx_PyMODINIT_FUNC initcsmoothers(void)
22887 #else
22888 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void) CYTHON_SMALL_CODE; /*proto*/
22889 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)
22890 #if CYTHON_PEP489_MULTI_PHASE_INIT
22891 {
22892  return PyModuleDef_Init(&__pyx_moduledef);
22893 }
22894 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
22895  #if PY_VERSION_HEX >= 0x030700A1
22896  static PY_INT64_T main_interpreter_id = -1;
22897  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22898  if (main_interpreter_id == -1) {
22899  main_interpreter_id = current_id;
22900  return (unlikely(current_id == -1)) ? -1 : 0;
22901  } else if (unlikely(main_interpreter_id != current_id))
22902  #else
22903  static PyInterpreterState *main_interpreter = NULL;
22904  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22905  if (!main_interpreter) {
22906  main_interpreter = current_interpreter;
22907  } else if (unlikely(main_interpreter != current_interpreter))
22908  #endif
22909  {
22910  PyErr_SetString(
22911  PyExc_ImportError,
22912  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22913  return -1;
22914  }
22915  return 0;
22916 }
22917 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
22918  PyObject *value = PyObject_GetAttrString(spec, from_name);
22919  int result = 0;
22920  if (likely(value)) {
22921  if (allow_none || value != Py_None) {
22922  result = PyDict_SetItemString(moddict, to_name, value);
22923  }
22924  Py_DECREF(value);
22925  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22926  PyErr_Clear();
22927  } else {
22928  result = -1;
22929  }
22930  return result;
22931 }
22932 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22933  PyObject *module = NULL, *moddict, *modname;
22934  if (__Pyx_check_single_interpreter())
22935  return NULL;
22936  if (__pyx_m)
22937  return __Pyx_NewRef(__pyx_m);
22938  modname = PyObject_GetAttrString(spec, "name");
22939  if (unlikely(!modname)) goto bad;
22940  module = PyModule_NewObject(modname);
22941  Py_DECREF(modname);
22942  if (unlikely(!module)) goto bad;
22943  moddict = PyModule_GetDict(module);
22944  if (unlikely(!moddict)) goto bad;
22945  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
22946  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
22947  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
22948  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
22949  return module;
22950 bad:
22951  Py_XDECREF(module);
22952  return NULL;
22953 }
22954 
22955 
22956 static CYTHON_SMALL_CODE int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
22957 #endif
22958 #endif
22959 {
22960  PyObject *__pyx_t_1 = NULL;
22961  PyObject *__pyx_t_2 = NULL;
22962  PyObject *__pyx_t_3 = NULL;
22963  static PyThread_type_lock __pyx_t_4[8];
22964  int __pyx_lineno = 0;
22965  const char *__pyx_filename = NULL;
22966  int __pyx_clineno = 0;
22967  __Pyx_RefNannyDeclarations
22968  #if CYTHON_PEP489_MULTI_PHASE_INIT
22969  if (__pyx_m) {
22970  if (__pyx_m == __pyx_pyinit_module) return 0;
22971  PyErr_SetString(PyExc_RuntimeError, "Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
22972  return -1;
22973  }
22974  #elif PY_MAJOR_VERSION >= 3
22975  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22976  #endif
22977  #if CYTHON_REFNANNY
22978 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22979 if (!__Pyx_RefNanny) {
22980  PyErr_Clear();
22981  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22982  if (!__Pyx_RefNanny)
22983  Py_FatalError("failed to import 'refnanny' module");
22984 }
22985 #endif
22986  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
22987  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22988  #ifdef __Pxy_PyFrame_Initialize_Offsets
22989  __Pxy_PyFrame_Initialize_Offsets();
22990  #endif
22991  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22992  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22993  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22994  #ifdef __Pyx_CyFunction_USED
22995  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22996  #endif
22997  #ifdef __Pyx_FusedFunction_USED
22998  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22999  #endif
23000  #ifdef __Pyx_Coroutine_USED
23001  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23002  #endif
23003  #ifdef __Pyx_Generator_USED
23004  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23005  #endif
23006  #ifdef __Pyx_AsyncGen_USED
23007  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23008  #endif
23009  #ifdef __Pyx_StopAsyncIteration_USED
23010  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23011  #endif
23012  /*--- Library function declarations ---*/
23013  /*--- Threads initialization code ---*/
23014  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23015  PyEval_InitThreads();
23016  #endif
23017  /*--- Module creation code ---*/
23018  #if CYTHON_PEP489_MULTI_PHASE_INIT
23019  __pyx_m = __pyx_pyinit_module;
23020  Py_INCREF(__pyx_m);
23021  #else
23022  #if PY_MAJOR_VERSION < 3
23023  __pyx_m = Py_InitModule4("csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23024  #else
23025  __pyx_m = PyModule_Create(&__pyx_moduledef);
23026  #endif
23027  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23028  #endif
23029  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23030  Py_INCREF(__pyx_d);
23031  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23032  Py_INCREF(__pyx_b);
23033  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23034  Py_INCREF(__pyx_cython_runtime);
23035  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23036  /*--- Initialize various global constants etc. ---*/
23037  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23038  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23039  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23040  #endif
23041  if (__pyx_module_is_main_csmoothers) {
23042  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23043  }
23044  #if PY_MAJOR_VERSION >= 3
23045  {
23046  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23047  if (!PyDict_GetItemString(modules, "csmoothers")) {
23048  if (unlikely(PyDict_SetItemString(modules, "csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23049  }
23050  }
23051  #endif
23052  /*--- Builtin init code ---*/
23053  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23054  /*--- Constants init code ---*/
23055  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23056  /*--- Global type/function init code ---*/
23057  (void)__Pyx_modinit_global_init_code();
23058  (void)__Pyx_modinit_variable_export_code();
23059  (void)__Pyx_modinit_function_export_code();
23060  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23061  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23062  (void)__Pyx_modinit_variable_import_code();
23063  (void)__Pyx_modinit_function_import_code();
23064  /*--- Execution code ---*/
23065  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23066  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23067  #endif
23068 
23069  /* "csmoothers.pyx":1
23070  * import numpy as np # <<<<<<<<<<<<<<
23071  * import cython
23072  * cimport numpy as np
23073  */
23074  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23075  __Pyx_GOTREF(__pyx_t_1);
23076  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23077  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23078 
23079  /* "csmoothers.pyx":5
23080  * cimport numpy as np
23081  *
23082  * class ASMFactor(object): # <<<<<<<<<<<<<<
23083  *
23084  * def __init__(self, L):
23085  */
23086  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__25); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
23087  __Pyx_GOTREF(__pyx_t_1);
23088  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__25, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
23089  __Pyx_GOTREF(__pyx_t_2);
23090 
23091  /* "csmoothers.pyx":7
23092  * class ASMFactor(object):
23093  *
23094  * def __init__(self, L): # <<<<<<<<<<<<<<
23095  * self.L = L
23096  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
23097  */
23098  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
23099  __Pyx_GOTREF(__pyx_t_3);
23100  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23101  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23102 
23103  /* "csmoothers.pyx":5
23104  * cimport numpy as np
23105  *
23106  * class ASMFactor(object): # <<<<<<<<<<<<<<
23107  *
23108  * def __init__(self, L):
23109  */
23110  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__25, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
23111  __Pyx_GOTREF(__pyx_t_3);
23112  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
23113  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23114  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23115  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23116 
23117  /* "csmoothers.pyx":42
23118  *
23119  *
23120  * class BASMFactor(object): # <<<<<<<<<<<<<<
23121  *
23122  * def __init__(self, L, bs):
23123  */
23124  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__28); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
23125  __Pyx_GOTREF(__pyx_t_1);
23126  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__28, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
23127  __Pyx_GOTREF(__pyx_t_2);
23128 
23129  /* "csmoothers.pyx":44
23130  * class BASMFactor(object):
23131  *
23132  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
23133  * self.L = L
23134  * self.bs = bs
23135  */
23136  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
23137  __Pyx_GOTREF(__pyx_t_3);
23138  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
23139  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23140 
23141  /* "csmoothers.pyx":42
23142  *
23143  *
23144  * class BASMFactor(object): # <<<<<<<<<<<<<<
23145  *
23146  * def __init__(self, L, bs):
23147  */
23148  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__28, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
23149  __Pyx_GOTREF(__pyx_t_3);
23150  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
23151  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23152  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23153  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23154 
23155  /* "csmoothers.pyx":84
23156  * self.subdomain_col_pivots)
23157  *
23158  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
23159  * """
23160  *
23161  */
23162  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23163  __Pyx_GOTREF(__pyx_t_1);
23164  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23165  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23166 
23167  /* "csmoothers.pyx":109
23168  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
23169  *
23170  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23171  * """
23172  *
23173  */
23174  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
23175  __Pyx_GOTREF(__pyx_t_1);
23176  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
23177  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23178 
23179  /* "csmoothers.pyx":136
23180  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23181  *
23182  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23183  * """
23184  *
23185  */
23186  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
23187  __Pyx_GOTREF(__pyx_t_1);
23188  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
23189  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23190 
23191  /* "csmoothers.pyx":165
23192  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23193  *
23194  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23195  * """
23196  *
23197  */
23198  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23199  __Pyx_GOTREF(__pyx_t_1);
23200  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23201  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23202 
23203  /* "csmoothers.pyx":190
23204  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23205  *
23206  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23207  * """
23208  *
23209  */
23210  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
23211  __Pyx_GOTREF(__pyx_t_1);
23212  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
23213  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23214 
23215  /* "csmoothers.pyx":217
23216  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23217  *
23218  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23219  * """
23220  *
23221  */
23222  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
23223  __Pyx_GOTREF(__pyx_t_1);
23224  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
23225  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23226 
23227  /* "csmoothers.pyx":251
23228  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23229  *
23230  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
23231  * """
23232  *
23233  */
23234  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
23235  __Pyx_GOTREF(__pyx_t_1);
23236  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
23237  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23238 
23239  /* "csmoothers.pyx":277
23240  * asmFactor.subdomain_pivots)
23241  *
23242  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23243  * """
23244  *
23245  */
23246  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
23247  __Pyx_GOTREF(__pyx_t_1);
23248  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
23249  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23250 
23251  /* "csmoothers.pyx":321
23252  * asmFactor.subdomain_pivots)
23253  *
23254  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
23255  * """
23256  *
23257  */
23258  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
23259  __Pyx_GOTREF(__pyx_t_1);
23260  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
23261  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23262 
23263  /* "csmoothers.pyx":350
23264  *
23265  *
23266  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23267  * """
23268  *
23269  */
23270  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
23271  __Pyx_GOTREF(__pyx_t_1);
23272  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
23273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23274 
23275  /* "csmoothers.pyx":1
23276  * import numpy as np # <<<<<<<<<<<<<<
23277  * import cython
23278  * cimport numpy as np
23279  */
23280  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23281  __Pyx_GOTREF(__pyx_t_1);
23282  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23283  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23284 
23285  /* "View.MemoryView":209
23286  * info.obj = self
23287  *
23288  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23289  *
23290  * def __dealloc__(array self):
23291  */
23292  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23293  __Pyx_GOTREF(__pyx_t_1);
23294  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23295  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23296  PyType_Modified(__pyx_array_type);
23297 
23298  /* "View.MemoryView":286
23299  * return self.name
23300  *
23301  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23302  * cdef strided = Enum("<strided and direct>") # default
23303  * cdef indirect = Enum("<strided and indirect>")
23304  */
23305  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23306  __Pyx_GOTREF(__pyx_t_1);
23307  __Pyx_XGOTREF(generic);
23308  __Pyx_DECREF_SET(generic, __pyx_t_1);
23309  __Pyx_GIVEREF(__pyx_t_1);
23310  __pyx_t_1 = 0;
23311 
23312  /* "View.MemoryView":287
23313  *
23314  * cdef generic = Enum("<strided and direct or indirect>")
23315  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23316  * cdef indirect = Enum("<strided and indirect>")
23317  *
23318  */
23319  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23320  __Pyx_GOTREF(__pyx_t_1);
23321  __Pyx_XGOTREF(strided);
23322  __Pyx_DECREF_SET(strided, __pyx_t_1);
23323  __Pyx_GIVEREF(__pyx_t_1);
23324  __pyx_t_1 = 0;
23325 
23326  /* "View.MemoryView":288
23327  * cdef generic = Enum("<strided and direct or indirect>")
23328  * cdef strided = Enum("<strided and direct>") # default
23329  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23330  *
23331  *
23332  */
23333  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23334  __Pyx_GOTREF(__pyx_t_1);
23335  __Pyx_XGOTREF(indirect);
23336  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23337  __Pyx_GIVEREF(__pyx_t_1);
23338  __pyx_t_1 = 0;
23339 
23340  /* "View.MemoryView":291
23341  *
23342  *
23343  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23344  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23345  *
23346  */
23347  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23348  __Pyx_GOTREF(__pyx_t_1);
23349  __Pyx_XGOTREF(contiguous);
23350  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23351  __Pyx_GIVEREF(__pyx_t_1);
23352  __pyx_t_1 = 0;
23353 
23354  /* "View.MemoryView":292
23355  *
23356  * cdef contiguous = Enum("<contiguous and direct>")
23357  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23358  *
23359  *
23360  */
23361  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23362  __Pyx_GOTREF(__pyx_t_1);
23363  __Pyx_XGOTREF(indirect_contiguous);
23364  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23365  __Pyx_GIVEREF(__pyx_t_1);
23366  __pyx_t_1 = 0;
23367 
23368  /* "View.MemoryView":316
23369  *
23370  * DEF THREAD_LOCKS_PREALLOCATED = 8
23371  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23372  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23373  * PyThread_allocate_lock(),
23374  */
23375  __pyx_memoryview_thread_locks_used = 0;
23376 
23377  /* "View.MemoryView":317
23378  * DEF THREAD_LOCKS_PREALLOCATED = 8
23379  * cdef int __pyx_memoryview_thread_locks_used = 0
23380  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23381  * PyThread_allocate_lock(),
23382  * PyThread_allocate_lock(),
23383  */
23384  __pyx_t_4[0] = PyThread_allocate_lock();
23385  __pyx_t_4[1] = PyThread_allocate_lock();
23386  __pyx_t_4[2] = PyThread_allocate_lock();
23387  __pyx_t_4[3] = PyThread_allocate_lock();
23388  __pyx_t_4[4] = PyThread_allocate_lock();
23389  __pyx_t_4[5] = PyThread_allocate_lock();
23390  __pyx_t_4[6] = PyThread_allocate_lock();
23391  __pyx_t_4[7] = PyThread_allocate_lock();
23392  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23393 
23394  /* "View.MemoryView":549
23395  * info.obj = self
23396  *
23397  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23398  *
23399  *
23400  */
23401  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
23402  __Pyx_GOTREF(__pyx_t_1);
23403  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
23404  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23405  PyType_Modified(__pyx_memoryview_type);
23406 
23407  /* "View.MemoryView":995
23408  * return self.from_object
23409  *
23410  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23411  *
23412  *
23413  */
23414  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
23415  __Pyx_GOTREF(__pyx_t_1);
23416  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
23417  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23418  PyType_Modified(__pyx_memoryviewslice_type);
23419 
23420  /* "(tree fragment)":1
23421  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23422  * cdef object __pyx_PickleError
23423  * cdef object __pyx_result
23424  */
23425  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23426  __Pyx_GOTREF(__pyx_t_1);
23427  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23428  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23429 
23430  /* "(tree fragment)":11
23431  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23432  * return __pyx_result
23433  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23434  * __pyx_result.name = __pyx_state[0]
23435  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23436  */
23437 
23438  /*--- Wrapped vars code ---*/
23439 
23440  goto __pyx_L0;
23441  __pyx_L1_error:;
23442  __Pyx_XDECREF(__pyx_t_1);
23443  __Pyx_XDECREF(__pyx_t_2);
23444  __Pyx_XDECREF(__pyx_t_3);
23445  if (__pyx_m) {
23446  if (__pyx_d) {
23447  __Pyx_AddTraceback("init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
23448  }
23449  Py_CLEAR(__pyx_m);
23450  } else if (!PyErr_Occurred()) {
23451  PyErr_SetString(PyExc_ImportError, "init csmoothers");
23452  }
23453  __pyx_L0:;
23454  __Pyx_RefNannyFinishContext();
23455  #if CYTHON_PEP489_MULTI_PHASE_INIT
23456  return (__pyx_m != NULL) ? 0 : -1;
23457  #elif PY_MAJOR_VERSION >= 3
23458  return __pyx_m;
23459  #else
23460  return;
23461  #endif
23462 }
23463 
23464 /* --- Runtime support code --- */
23465 /* Refnanny */
23466 #if CYTHON_REFNANNY
23467 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23468  PyObject *m = NULL, *p = NULL;
23469  void *r = NULL;
23470  m = PyImport_ImportModule(modname);
23471  if (!m) goto end;
23472  p = PyObject_GetAttrString(m, "RefNannyAPI");
23473  if (!p) goto end;
23474  r = PyLong_AsVoidPtr(p);
23475 end:
23476  Py_XDECREF(p);
23477  Py_XDECREF(m);
23478  return (__Pyx_RefNannyAPIStruct *)r;
23479 }
23480 #endif
23481 
23482 /* PyObjectGetAttrStr */
23483 #if CYTHON_USE_TYPE_SLOTS
23484 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23485  PyTypeObject* tp = Py_TYPE(obj);
23486  if (likely(tp->tp_getattro))
23487  return tp->tp_getattro(obj, attr_name);
23488 #if PY_MAJOR_VERSION < 3
23489  if (likely(tp->tp_getattr))
23490  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23491 #endif
23492  return PyObject_GetAttr(obj, attr_name);
23493 }
23494 #endif
23495 
23496 /* GetBuiltinName */
23497 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23498  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23499  if (unlikely(!result)) {
23500  PyErr_Format(PyExc_NameError,
23501 #if PY_MAJOR_VERSION >= 3
23502  "name '%U' is not defined", name);
23503 #else
23504  "name '%.200s' is not defined", PyString_AS_STRING(name));
23505 #endif
23506  }
23507  return result;
23508 }
23509 
23510 /* RaiseArgTupleInvalid */
23511 static void __Pyx_RaiseArgtupleInvalid(
23512  const char* func_name,
23513  int exact,
23514  Py_ssize_t num_min,
23515  Py_ssize_t num_max,
23516  Py_ssize_t num_found)
23517 {
23518  Py_ssize_t num_expected;
23519  const char *more_or_less;
23520  if (num_found < num_min) {
23521  num_expected = num_min;
23522  more_or_less = "at least";
23523  } else {
23524  num_expected = num_max;
23525  more_or_less = "at most";
23526  }
23527  if (exact) {
23528  more_or_less = "exactly";
23529  }
23530  PyErr_Format(PyExc_TypeError,
23531  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23532  func_name, more_or_less, num_expected,
23533  (num_expected == 1) ? "" : "s", num_found);
23534 }
23535 
23536 /* RaiseDoubleKeywords */
23537 static void __Pyx_RaiseDoubleKeywordsError(
23538  const char* func_name,
23539  PyObject* kw_name)
23540 {
23541  PyErr_Format(PyExc_TypeError,
23542  #if PY_MAJOR_VERSION >= 3
23543  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23544  #else
23545  "%s() got multiple values for keyword argument '%s'", func_name,
23546  PyString_AsString(kw_name));
23547  #endif
23548 }
23549 
23550 /* ParseKeywords */
23551 static int __Pyx_ParseOptionalKeywords(
23552  PyObject *kwds,
23553  PyObject **argnames[],
23554  PyObject *kwds2,
23555  PyObject *values[],
23556  Py_ssize_t num_pos_args,
23557  const char* function_name)
23558 {
23559  PyObject *key = 0, *value = 0;
23560  Py_ssize_t pos = 0;
23561  PyObject*** name;
23562  PyObject*** first_kw_arg = argnames + num_pos_args;
23563  while (PyDict_Next(kwds, &pos, &key, &value)) {
23564  name = first_kw_arg;
23565  while (*name && (**name != key)) name++;
23566  if (*name) {
23567  values[name-argnames] = value;
23568  continue;
23569  }
23570  name = first_kw_arg;
23571  #if PY_MAJOR_VERSION < 3
23572  if (likely(PyString_Check(key))) {
23573  while (*name) {
23574  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23575  && _PyString_Eq(**name, key)) {
23576  values[name-argnames] = value;
23577  break;
23578  }
23579  name++;
23580  }
23581  if (*name) continue;
23582  else {
23583  PyObject*** argname = argnames;
23584  while (argname != first_kw_arg) {
23585  if ((**argname == key) || (
23586  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23587  && _PyString_Eq(**argname, key))) {
23588  goto arg_passed_twice;
23589  }
23590  argname++;
23591  }
23592  }
23593  } else
23594  #endif
23595  if (likely(PyUnicode_Check(key))) {
23596  while (*name) {
23597  int cmp = (**name == key) ? 0 :
23598  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23599  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23600  #endif
23601  PyUnicode_Compare(**name, key);
23602  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23603  if (cmp == 0) {
23604  values[name-argnames] = value;
23605  break;
23606  }
23607  name++;
23608  }
23609  if (*name) continue;
23610  else {
23611  PyObject*** argname = argnames;
23612  while (argname != first_kw_arg) {
23613  int cmp = (**argname == key) ? 0 :
23614  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23615  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23616  #endif
23617  PyUnicode_Compare(**argname, key);
23618  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23619  if (cmp == 0) goto arg_passed_twice;
23620  argname++;
23621  }
23622  }
23623  } else
23624  goto invalid_keyword_type;
23625  if (kwds2) {
23626  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23627  } else {
23628  goto invalid_keyword;
23629  }
23630  }
23631  return 0;
23632 arg_passed_twice:
23633  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23634  goto bad;
23635 invalid_keyword_type:
23636  PyErr_Format(PyExc_TypeError,
23637  "%.200s() keywords must be strings", function_name);
23638  goto bad;
23639 invalid_keyword:
23640  PyErr_Format(PyExc_TypeError,
23641  #if PY_MAJOR_VERSION < 3
23642  "%.200s() got an unexpected keyword argument '%.200s'",
23643  function_name, PyString_AsString(key));
23644  #else
23645  "%s() got an unexpected keyword argument '%U'",
23646  function_name, key);
23647  #endif
23648 bad:
23649  return -1;
23650 }
23651 
23652 /* PyObjectSetAttrStr */
23653 #if CYTHON_USE_TYPE_SLOTS
23654 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23655  PyTypeObject* tp = Py_TYPE(obj);
23656  if (likely(tp->tp_setattro))
23657  return tp->tp_setattro(obj, attr_name, value);
23658 #if PY_MAJOR_VERSION < 3
23659  if (likely(tp->tp_setattr))
23660  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
23661 #endif
23662  return PyObject_SetAttr(obj, attr_name, value);
23663 }
23664 #endif
23665 
23666 /* PyCFunctionFastCall */
23667 #if CYTHON_FAST_PYCCALL
23668 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23669  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23670  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23671  PyObject *self = PyCFunction_GET_SELF(func);
23672  int flags = PyCFunction_GET_FLAGS(func);
23673  assert(PyCFunction_Check(func));
23674  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23675  assert(nargs >= 0);
23676  assert(nargs == 0 || args != NULL);
23677  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23678  because it may clear it (directly or indirectly) and so the
23679  caller loses its exception */
23680  assert(!PyErr_Occurred());
23681  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23682  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
23683  } else {
23684  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
23685  }
23686 }
23687 #endif
23688 
23689 /* PyFunctionFastCall */
23690 #if CYTHON_FAST_PYCALL
23691 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23692  PyObject *globals) {
23693  PyFrameObject *f;
23694  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23695  PyObject **fastlocals;
23696  Py_ssize_t i;
23697  PyObject *result;
23698  assert(globals != NULL);
23699  /* XXX Perhaps we should create a specialized
23700  PyFrame_New() that doesn't take locals, but does
23701  take builtins without sanity checking them.
23702  */
23703  assert(tstate != NULL);
23704  f = PyFrame_New(tstate, co, globals, NULL);
23705  if (f == NULL) {
23706  return NULL;
23707  }
23708  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23709  for (i = 0; i < na; i++) {
23710  Py_INCREF(*args);
23711  fastlocals[i] = *args++;
23712  }
23713  result = PyEval_EvalFrameEx(f,0);
23714  ++tstate->recursion_depth;
23715  Py_DECREF(f);
23716  --tstate->recursion_depth;
23717  return result;
23718 }
23719 #if 1 || PY_VERSION_HEX < 0x030600B1
23720 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23721  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23722  PyObject *globals = PyFunction_GET_GLOBALS(func);
23723  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23724  PyObject *closure;
23725 #if PY_MAJOR_VERSION >= 3
23726  PyObject *kwdefs;
23727 #endif
23728  PyObject *kwtuple, **k;
23729  PyObject **d;
23730  Py_ssize_t nd;
23731  Py_ssize_t nk;
23732  PyObject *result;
23733  assert(kwargs == NULL || PyDict_Check(kwargs));
23734  nk = kwargs ? PyDict_Size(kwargs) : 0;
23735  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
23736  return NULL;
23737  }
23738  if (
23739 #if PY_MAJOR_VERSION >= 3
23740  co->co_kwonlyargcount == 0 &&
23741 #endif
23742  likely(kwargs == NULL || nk == 0) &&
23743  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23744  if (argdefs == NULL && co->co_argcount == nargs) {
23745  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23746  goto done;
23747  }
23748  else if (nargs == 0 && argdefs != NULL
23749  && co->co_argcount == Py_SIZE(argdefs)) {
23750  /* function called with no arguments, but all parameters have
23751  a default value: use default values as arguments .*/
23752  args = &PyTuple_GET_ITEM(argdefs, 0);
23753  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23754  goto done;
23755  }
23756  }
23757  if (kwargs != NULL) {
23758  Py_ssize_t pos, i;
23759  kwtuple = PyTuple_New(2 * nk);
23760  if (kwtuple == NULL) {
23761  result = NULL;
23762  goto done;
23763  }
23764  k = &PyTuple_GET_ITEM(kwtuple, 0);
23765  pos = i = 0;
23766  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23767  Py_INCREF(k[i]);
23768  Py_INCREF(k[i+1]);
23769  i += 2;
23770  }
23771  nk = i / 2;
23772  }
23773  else {
23774  kwtuple = NULL;
23775  k = NULL;
23776  }
23777  closure = PyFunction_GET_CLOSURE(func);
23778 #if PY_MAJOR_VERSION >= 3
23779  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23780 #endif
23781  if (argdefs != NULL) {
23782  d = &PyTuple_GET_ITEM(argdefs, 0);
23783  nd = Py_SIZE(argdefs);
23784  }
23785  else {
23786  d = NULL;
23787  nd = 0;
23788  }
23789 #if PY_MAJOR_VERSION >= 3
23790  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23791  args, (int)nargs,
23792  k, (int)nk,
23793  d, (int)nd, kwdefs, closure);
23794 #else
23795  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23796  args, (int)nargs,
23797  k, (int)nk,
23798  d, (int)nd, closure);
23799 #endif
23800  Py_XDECREF(kwtuple);
23801 done:
23802  Py_LeaveRecursiveCall();
23803  return result;
23804 }
23805 #endif
23806 #endif
23807 
23808 /* PyObjectCall */
23809 #if CYTHON_COMPILING_IN_CPYTHON
23810 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23811  PyObject *result;
23812  ternaryfunc call = Py_TYPE(func)->tp_call;
23813  if (unlikely(!call))
23814  return PyObject_Call(func, arg, kw);
23815  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23816  return NULL;
23817  result = (*call)(func, arg, kw);
23818  Py_LeaveRecursiveCall();
23819  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23820  PyErr_SetString(
23821  PyExc_SystemError,
23822  "NULL result without error in PyObject_Call");
23823  }
23824  return result;
23825 }
23826 #endif
23827 
23828 /* PyObjectCallMethO */
23829 #if CYTHON_COMPILING_IN_CPYTHON
23830 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23831  PyObject *self, *result;
23832  PyCFunction cfunc;
23833  cfunc = PyCFunction_GET_FUNCTION(func);
23834  self = PyCFunction_GET_SELF(func);
23835  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23836  return NULL;
23837  result = cfunc(self, arg);
23838  Py_LeaveRecursiveCall();
23839  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23840  PyErr_SetString(
23841  PyExc_SystemError,
23842  "NULL result without error in PyObject_Call");
23843  }
23844  return result;
23845 }
23846 #endif
23847 
23848 /* PyObjectCallOneArg */
23849 #if CYTHON_COMPILING_IN_CPYTHON
23850 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23851  PyObject *result;
23852  PyObject *args = PyTuple_New(1);
23853  if (unlikely(!args)) return NULL;
23854  Py_INCREF(arg);
23855  PyTuple_SET_ITEM(args, 0, arg);
23856  result = __Pyx_PyObject_Call(func, args, NULL);
23857  Py_DECREF(args);
23858  return result;
23859 }
23860 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23861 #if CYTHON_FAST_PYCALL
23862  if (PyFunction_Check(func)) {
23863  return __Pyx_PyFunction_FastCall(func, &arg, 1);
23864  }
23865 #endif
23866  if (likely(PyCFunction_Check(func))) {
23867  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23868  return __Pyx_PyObject_CallMethO(func, arg);
23869 #if CYTHON_FAST_PYCCALL
23870  } else if (__Pyx_PyFastCFunction_Check(func)) {
23871  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23872 #endif
23873  }
23874  }
23875  return __Pyx__PyObject_CallOneArg(func, arg);
23876 }
23877 #else
23878 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23879  PyObject *result;
23880  PyObject *args = PyTuple_Pack(1, arg);
23881  if (unlikely(!args)) return NULL;
23882  result = __Pyx_PyObject_Call(func, args, NULL);
23883  Py_DECREF(args);
23884  return result;
23885 }
23886 #endif
23887 
23888 /* ArgTypeTest */
23889 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23890 {
23891  if (unlikely(!type)) {
23892  PyErr_SetString(PyExc_SystemError, "Missing type object");
23893  return 0;
23894  }
23895  else if (exact) {
23896  #if PY_MAJOR_VERSION == 2
23897  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23898  #endif
23899  }
23900  else {
23901  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23902  }
23903  PyErr_Format(PyExc_TypeError,
23904  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23905  name, type->tp_name, Py_TYPE(obj)->tp_name);
23906  return 0;
23907 }
23908 
23909 /* PyErrFetchRestore */
23910 #if CYTHON_FAST_THREAD_STATE
23911 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23912  PyObject *tmp_type, *tmp_value, *tmp_tb;
23913  tmp_type = tstate->curexc_type;
23914  tmp_value = tstate->curexc_value;
23915  tmp_tb = tstate->curexc_traceback;
23916  tstate->curexc_type = type;
23917  tstate->curexc_value = value;
23918  tstate->curexc_traceback = tb;
23919  Py_XDECREF(tmp_type);
23920  Py_XDECREF(tmp_value);
23921  Py_XDECREF(tmp_tb);
23922 }
23923 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23924  *type = tstate->curexc_type;
23925  *value = tstate->curexc_value;
23926  *tb = tstate->curexc_traceback;
23927  tstate->curexc_type = 0;
23928  tstate->curexc_value = 0;
23929  tstate->curexc_traceback = 0;
23930 }
23931 #endif
23932 
23933 /* RaiseException */
23934 #if PY_MAJOR_VERSION < 3
23935 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
23936  CYTHON_UNUSED PyObject *cause) {
23937  __Pyx_PyThreadState_declare
23938  Py_XINCREF(type);
23939  if (!value || value == Py_None)
23940  value = NULL;
23941  else
23942  Py_INCREF(value);
23943  if (!tb || tb == Py_None)
23944  tb = NULL;
23945  else {
23946  Py_INCREF(tb);
23947  if (!PyTraceBack_Check(tb)) {
23948  PyErr_SetString(PyExc_TypeError,
23949  "raise: arg 3 must be a traceback or None");
23950  goto raise_error;
23951  }
23952  }
23953  if (PyType_Check(type)) {
23954 #if CYTHON_COMPILING_IN_PYPY
23955  if (!value) {
23956  Py_INCREF(Py_None);
23957  value = Py_None;
23958  }
23959 #endif
23960  PyErr_NormalizeException(&type, &value, &tb);
23961  } else {
23962  if (value) {
23963  PyErr_SetString(PyExc_TypeError,
23964  "instance exception may not have a separate value");
23965  goto raise_error;
23966  }
23967  value = type;
23968  type = (PyObject*) Py_TYPE(type);
23969  Py_INCREF(type);
23970  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23971  PyErr_SetString(PyExc_TypeError,
23972  "raise: exception class must be a subclass of BaseException");
23973  goto raise_error;
23974  }
23975  }
23976  __Pyx_PyThreadState_assign
23977  __Pyx_ErrRestore(type, value, tb);
23978  return;
23979 raise_error:
23980  Py_XDECREF(value);
23981  Py_XDECREF(type);
23982  Py_XDECREF(tb);
23983  return;
23984 }
23985 #else
23986 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23987  PyObject* owned_instance = NULL;
23988  if (tb == Py_None) {
23989  tb = 0;
23990  } else if (tb && !PyTraceBack_Check(tb)) {
23991  PyErr_SetString(PyExc_TypeError,
23992  "raise: arg 3 must be a traceback or None");
23993  goto bad;
23994  }
23995  if (value == Py_None)
23996  value = 0;
23997  if (PyExceptionInstance_Check(type)) {
23998  if (value) {
23999  PyErr_SetString(PyExc_TypeError,
24000  "instance exception may not have a separate value");
24001  goto bad;
24002  }
24003  value = type;
24004  type = (PyObject*) Py_TYPE(value);
24005  } else if (PyExceptionClass_Check(type)) {
24006  PyObject *instance_class = NULL;
24007  if (value && PyExceptionInstance_Check(value)) {
24008  instance_class = (PyObject*) Py_TYPE(value);
24009  if (instance_class != type) {
24010  int is_subclass = PyObject_IsSubclass(instance_class, type);
24011  if (!is_subclass) {
24012  instance_class = NULL;
24013  } else if (unlikely(is_subclass == -1)) {
24014  goto bad;
24015  } else {
24016  type = instance_class;
24017  }
24018  }
24019  }
24020  if (!instance_class) {
24021  PyObject *args;
24022  if (!value)
24023  args = PyTuple_New(0);
24024  else if (PyTuple_Check(value)) {
24025  Py_INCREF(value);
24026  args = value;
24027  } else
24028  args = PyTuple_Pack(1, value);
24029  if (!args)
24030  goto bad;
24031  owned_instance = PyObject_Call(type, args, NULL);
24032  Py_DECREF(args);
24033  if (!owned_instance)
24034  goto bad;
24035  value = owned_instance;
24036  if (!PyExceptionInstance_Check(value)) {
24037  PyErr_Format(PyExc_TypeError,
24038  "calling %R should have returned an instance of "
24039  "BaseException, not %R",
24040  type, Py_TYPE(value));
24041  goto bad;
24042  }
24043  }
24044  } else {
24045  PyErr_SetString(PyExc_TypeError,
24046  "raise: exception class must be a subclass of BaseException");
24047  goto bad;
24048  }
24049  if (cause) {
24050  PyObject *fixed_cause;
24051  if (cause == Py_None) {
24052  fixed_cause = NULL;
24053  } else if (PyExceptionClass_Check(cause)) {
24054  fixed_cause = PyObject_CallObject(cause, NULL);
24055  if (fixed_cause == NULL)
24056  goto bad;
24057  } else if (PyExceptionInstance_Check(cause)) {
24058  fixed_cause = cause;
24059  Py_INCREF(fixed_cause);
24060  } else {
24061  PyErr_SetString(PyExc_TypeError,
24062  "exception causes must derive from "
24063  "BaseException");
24064  goto bad;
24065  }
24066  PyException_SetCause(value, fixed_cause);
24067  }
24068  PyErr_SetObject(type, value);
24069  if (tb) {
24070 #if CYTHON_COMPILING_IN_PYPY
24071  PyObject *tmp_type, *tmp_value, *tmp_tb;
24072  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24073  Py_INCREF(tb);
24074  PyErr_Restore(tmp_type, tmp_value, tb);
24075  Py_XDECREF(tmp_tb);
24076 #else
24077  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24078  PyObject* tmp_tb = tstate->curexc_traceback;
24079  if (tb != tmp_tb) {
24080  Py_INCREF(tb);
24081  tstate->curexc_traceback = tb;
24082  Py_XDECREF(tmp_tb);
24083  }
24084 #endif
24085  }
24086 bad:
24087  Py_XDECREF(owned_instance);
24088  return;
24089 }
24090 #endif
24091 
24092 /* ExtTypeTest */
24093 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24094  if (unlikely(!type)) {
24095  PyErr_SetString(PyExc_SystemError, "Missing type object");
24096  return 0;
24097  }
24098  if (likely(__Pyx_TypeCheck(obj, type)))
24099  return 1;
24100  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
24101  Py_TYPE(obj)->tp_name, type->tp_name);
24102  return 0;
24103 }
24104 
24105 /* MemviewSliceInit */
24106 static int
24107 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24108  int ndim,
24109  __Pyx_memviewslice *memviewslice,
24110  int memview_is_new_reference)
24111 {
24112  __Pyx_RefNannyDeclarations
24113  int i, retval=-1;
24114  Py_buffer *buf = &memview->view;
24115  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24116  if (unlikely(memviewslice->memview || memviewslice->data)) {
24117  PyErr_SetString(PyExc_ValueError,
24118  "memviewslice is already initialized!");
24119  goto fail;
24120  }
24121  if (buf->strides) {
24122  for (i = 0; i < ndim; i++) {
24123  memviewslice->strides[i] = buf->strides[i];
24124  }
24125  } else {
24126  Py_ssize_t stride = buf->itemsize;
24127  for (i = ndim - 1; i >= 0; i--) {
24128  memviewslice->strides[i] = stride;
24129  stride *= buf->shape[i];
24130  }
24131  }
24132  for (i = 0; i < ndim; i++) {
24133  memviewslice->shape[i] = buf->shape[i];
24134  if (buf->suboffsets) {
24135  memviewslice->suboffsets[i] = buf->suboffsets[i];
24136  } else {
24137  memviewslice->suboffsets[i] = -1;
24138  }
24139  }
24140  memviewslice->memview = memview;
24141  memviewslice->data = (char *)buf->buf;
24142  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24143  Py_INCREF(memview);
24144  }
24145  retval = 0;
24146  goto no_fail;
24147 fail:
24148  memviewslice->memview = 0;
24149  memviewslice->data = 0;
24150  retval = -1;
24151 no_fail:
24152  __Pyx_RefNannyFinishContext();
24153  return retval;
24154 }
24155 #ifndef Py_NO_RETURN
24156 #define Py_NO_RETURN
24157 #endif
24158 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24159  va_list vargs;
24160  char msg[200];
24161 #ifdef HAVE_STDARG_PROTOTYPES
24162  va_start(vargs, fmt);
24163 #else
24164  va_start(vargs);
24165 #endif
24166  vsnprintf(msg, 200, fmt, vargs);
24167  va_end(vargs);
24168  Py_FatalError(msg);
24169 }
24170 static CYTHON_INLINE int
24171 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24172  PyThread_type_lock lock)
24173 {
24174  int result;
24175  PyThread_acquire_lock(lock, 1);
24176  result = (*acquisition_count)++;
24177  PyThread_release_lock(lock);
24178  return result;
24179 }
24180 static CYTHON_INLINE int
24181 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24182  PyThread_type_lock lock)
24183 {
24184  int result;
24185  PyThread_acquire_lock(lock, 1);
24186  result = (*acquisition_count)--;
24187  PyThread_release_lock(lock);
24188  return result;
24189 }
24190 static CYTHON_INLINE void
24191 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24192 {
24193  int first_time;
24194  struct __pyx_memoryview_obj *memview = memslice->memview;
24195  if (unlikely(!memview || (PyObject *) memview == Py_None))
24196  return;
24197  if (unlikely(__pyx_get_slice_count(memview) < 0))
24198  __pyx_fatalerror("Acquisition count is %d (line %d)",
24199  __pyx_get_slice_count(memview), lineno);
24200  first_time = __pyx_add_acquisition_count(memview) == 0;
24201  if (unlikely(first_time)) {
24202  if (have_gil) {
24203  Py_INCREF((PyObject *) memview);
24204  } else {
24205  PyGILState_STATE _gilstate = PyGILState_Ensure();
24206  Py_INCREF((PyObject *) memview);
24207  PyGILState_Release(_gilstate);
24208  }
24209  }
24210 }
24211 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24212  int have_gil, int lineno) {
24213  int last_time;
24214  struct __pyx_memoryview_obj *memview = memslice->memview;
24215  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24216  memslice->memview = NULL;
24217  return;
24218  }
24219  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24220  __pyx_fatalerror("Acquisition count is %d (line %d)",
24221  __pyx_get_slice_count(memview), lineno);
24222  last_time = __pyx_sub_acquisition_count(memview) == 1;
24223  memslice->data = NULL;
24224  if (unlikely(last_time)) {
24225  if (have_gil) {
24226  Py_CLEAR(memslice->memview);
24227  } else {
24228  PyGILState_STATE _gilstate = PyGILState_Ensure();
24229  Py_CLEAR(memslice->memview);
24230  PyGILState_Release(_gilstate);
24231  }
24232  } else {
24233  memslice->memview = NULL;
24234  }
24235 }
24236 
24237 /* BufferIndexError */
24238 static void __Pyx_RaiseBufferIndexError(int axis) {
24239  PyErr_Format(PyExc_IndexError,
24240  "Out of bounds on buffer access (axis %d)", axis);
24241 }
24242 
24243 /* WriteUnraisableException */
24244 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24245  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24246  int full_traceback, CYTHON_UNUSED int nogil) {
24247  PyObject *old_exc, *old_val, *old_tb;
24248  PyObject *ctx;
24249  __Pyx_PyThreadState_declare
24250 #ifdef WITH_THREAD
24251  PyGILState_STATE state;
24252  if (nogil)
24253  state = PyGILState_Ensure();
24254 #ifdef _MSC_VER
24255  else state = (PyGILState_STATE)-1;
24256 #endif
24257 #endif
24258  __Pyx_PyThreadState_assign
24259  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24260  if (full_traceback) {
24261  Py_XINCREF(old_exc);
24262  Py_XINCREF(old_val);
24263  Py_XINCREF(old_tb);
24264  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24265  PyErr_PrintEx(1);
24266  }
24267  #if PY_MAJOR_VERSION < 3
24268  ctx = PyString_FromString(name);
24269  #else
24270  ctx = PyUnicode_FromString(name);
24271  #endif
24272  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24273  if (!ctx) {
24274  PyErr_WriteUnraisable(Py_None);
24275  } else {
24276  PyErr_WriteUnraisable(ctx);
24277  Py_DECREF(ctx);
24278  }
24279 #ifdef WITH_THREAD
24280  if (nogil)
24281  PyGILState_Release(state);
24282 #endif
24283 }
24284 
24285 /* GetTopmostException */
24286 #if CYTHON_USE_EXC_INFO_STACK
24287 static _PyErr_StackItem *
24288 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24289 {
24290  _PyErr_StackItem *exc_info = tstate->exc_info;
24291  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24292  exc_info->previous_item != NULL)
24293  {
24294  exc_info = exc_info->previous_item;
24295  }
24296  return exc_info;
24297 }
24298 #endif
24299 
24300 /* SaveResetException */
24301 #if CYTHON_FAST_THREAD_STATE
24302 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24303  #if CYTHON_USE_EXC_INFO_STACK
24304  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24305  *type = exc_info->exc_type;
24306  *value = exc_info->exc_value;
24307  *tb = exc_info->exc_traceback;
24308  #else
24309  *type = tstate->exc_type;
24310  *value = tstate->exc_value;
24311  *tb = tstate->exc_traceback;
24312  #endif
24313  Py_XINCREF(*type);
24314  Py_XINCREF(*value);
24315  Py_XINCREF(*tb);
24316 }
24317 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24318  PyObject *tmp_type, *tmp_value, *tmp_tb;
24319  #if CYTHON_USE_EXC_INFO_STACK
24320  _PyErr_StackItem *exc_info = tstate->exc_info;
24321  tmp_type = exc_info->exc_type;
24322  tmp_value = exc_info->exc_value;
24323  tmp_tb = exc_info->exc_traceback;
24324  exc_info->exc_type = type;
24325  exc_info->exc_value = value;
24326  exc_info->exc_traceback = tb;
24327  #else
24328  tmp_type = tstate->exc_type;
24329  tmp_value = tstate->exc_value;
24330  tmp_tb = tstate->exc_traceback;
24331  tstate->exc_type = type;
24332  tstate->exc_value = value;
24333  tstate->exc_traceback = tb;
24334  #endif
24335  Py_XDECREF(tmp_type);
24336  Py_XDECREF(tmp_value);
24337  Py_XDECREF(tmp_tb);
24338 }
24339 #endif
24340 
24341 /* PyErrExceptionMatches */
24342 #if CYTHON_FAST_THREAD_STATE
24343 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24344  Py_ssize_t i, n;
24345  n = PyTuple_GET_SIZE(tuple);
24346 #if PY_MAJOR_VERSION >= 3
24347  for (i=0; i<n; i++) {
24348  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24349  }
24350 #endif
24351  for (i=0; i<n; i++) {
24352  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24353  }
24354  return 0;
24355 }
24356 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24357  PyObject *exc_type = tstate->curexc_type;
24358  if (exc_type == err) return 1;
24359  if (unlikely(!exc_type)) return 0;
24360  if (unlikely(PyTuple_Check(err)))
24361  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24362  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24363 }
24364 #endif
24365 
24366 /* GetException */
24367 #if CYTHON_FAST_THREAD_STATE
24368 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24369 #else
24370 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24371 #endif
24372 {
24373  PyObject *local_type, *local_value, *local_tb;
24374 #if CYTHON_FAST_THREAD_STATE
24375  PyObject *tmp_type, *tmp_value, *tmp_tb;
24376  local_type = tstate->curexc_type;
24377  local_value = tstate->curexc_value;
24378  local_tb = tstate->curexc_traceback;
24379  tstate->curexc_type = 0;
24380  tstate->curexc_value = 0;
24381  tstate->curexc_traceback = 0;
24382 #else
24383  PyErr_Fetch(&local_type, &local_value, &local_tb);
24384 #endif
24385  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24386 #if CYTHON_FAST_THREAD_STATE
24387  if (unlikely(tstate->curexc_type))
24388 #else
24389  if (unlikely(PyErr_Occurred()))
24390 #endif
24391  goto bad;
24392  #if PY_MAJOR_VERSION >= 3
24393  if (local_tb) {
24394  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24395  goto bad;
24396  }
24397  #endif
24398  Py_XINCREF(local_tb);
24399  Py_XINCREF(local_type);
24400  Py_XINCREF(local_value);
24401  *type = local_type;
24402  *value = local_value;
24403  *tb = local_tb;
24404 #if CYTHON_FAST_THREAD_STATE
24405  #if CYTHON_USE_EXC_INFO_STACK
24406  {
24407  _PyErr_StackItem *exc_info = tstate->exc_info;
24408  tmp_type = exc_info->exc_type;
24409  tmp_value = exc_info->exc_value;
24410  tmp_tb = exc_info->exc_traceback;
24411  exc_info->exc_type = local_type;
24412  exc_info->exc_value = local_value;
24413  exc_info->exc_traceback = local_tb;
24414  }
24415  #else
24416  tmp_type = tstate->exc_type;
24417  tmp_value = tstate->exc_value;
24418  tmp_tb = tstate->exc_traceback;
24419  tstate->exc_type = local_type;
24420  tstate->exc_value = local_value;
24421  tstate->exc_traceback = local_tb;
24422  #endif
24423  Py_XDECREF(tmp_type);
24424  Py_XDECREF(tmp_value);
24425  Py_XDECREF(tmp_tb);
24426 #else
24427  PyErr_SetExcInfo(local_type, local_value, local_tb);
24428 #endif
24429  return 0;
24430 bad:
24431  *type = 0;
24432  *value = 0;
24433  *tb = 0;
24434  Py_XDECREF(local_type);
24435  Py_XDECREF(local_value);
24436  Py_XDECREF(local_tb);
24437  return -1;
24438 }
24439 
24440 /* PyObjectCall2Args */
24441 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24442  PyObject *args, *result = NULL;
24443  #if CYTHON_FAST_PYCALL
24444  if (PyFunction_Check(function)) {
24445  PyObject *args[2] = {arg1, arg2};
24446  return __Pyx_PyFunction_FastCall(function, args, 2);
24447  }
24448  #endif
24449  #if CYTHON_FAST_PYCCALL
24450  if (__Pyx_PyFastCFunction_Check(function)) {
24451  PyObject *args[2] = {arg1, arg2};
24452  return __Pyx_PyCFunction_FastCall(function, args, 2);
24453  }
24454  #endif
24455  args = PyTuple_New(2);
24456  if (unlikely(!args)) goto done;
24457  Py_INCREF(arg1);
24458  PyTuple_SET_ITEM(args, 0, arg1);
24459  Py_INCREF(arg2);
24460  PyTuple_SET_ITEM(args, 1, arg2);
24461  Py_INCREF(function);
24462  result = __Pyx_PyObject_Call(function, args, NULL);
24463  Py_DECREF(args);
24464  Py_DECREF(function);
24465 done:
24466  return result;
24467 }
24468 
24469 /* BytesEquals */
24470 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24471 #if CYTHON_COMPILING_IN_PYPY
24472  return PyObject_RichCompareBool(s1, s2, equals);
24473 #else
24474  if (s1 == s2) {
24475  return (equals == Py_EQ);
24476  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24477  const char *ps1, *ps2;
24478  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24479  if (length != PyBytes_GET_SIZE(s2))
24480  return (equals == Py_NE);
24481  ps1 = PyBytes_AS_STRING(s1);
24482  ps2 = PyBytes_AS_STRING(s2);
24483  if (ps1[0] != ps2[0]) {
24484  return (equals == Py_NE);
24485  } else if (length == 1) {
24486  return (equals == Py_EQ);
24487  } else {
24488  int result;
24489 #if CYTHON_USE_UNICODE_INTERNALS
24490  Py_hash_t hash1, hash2;
24491  hash1 = ((PyBytesObject*)s1)->ob_shash;
24492  hash2 = ((PyBytesObject*)s2)->ob_shash;
24493  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24494  return (equals == Py_NE);
24495  }
24496 #endif
24497  result = memcmp(ps1, ps2, (size_t)length);
24498  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24499  }
24500  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24501  return (equals == Py_NE);
24502  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24503  return (equals == Py_NE);
24504  } else {
24505  int result;
24506  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24507  if (!py_result)
24508  return -1;
24509  result = __Pyx_PyObject_IsTrue(py_result);
24510  Py_DECREF(py_result);
24511  return result;
24512  }
24513 #endif
24514 }
24515 
24516 /* UnicodeEquals */
24517 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24518 #if CYTHON_COMPILING_IN_PYPY
24519  return PyObject_RichCompareBool(s1, s2, equals);
24520 #else
24521 #if PY_MAJOR_VERSION < 3
24522  PyObject* owned_ref = NULL;
24523 #endif
24524  int s1_is_unicode, s2_is_unicode;
24525  if (s1 == s2) {
24526  goto return_eq;
24527  }
24528  s1_is_unicode = PyUnicode_CheckExact(s1);
24529  s2_is_unicode = PyUnicode_CheckExact(s2);
24530 #if PY_MAJOR_VERSION < 3
24531  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24532  owned_ref = PyUnicode_FromObject(s2);
24533  if (unlikely(!owned_ref))
24534  return -1;
24535  s2 = owned_ref;
24536  s2_is_unicode = 1;
24537  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24538  owned_ref = PyUnicode_FromObject(s1);
24539  if (unlikely(!owned_ref))
24540  return -1;
24541  s1 = owned_ref;
24542  s1_is_unicode = 1;
24543  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24544  return __Pyx_PyBytes_Equals(s1, s2, equals);
24545  }
24546 #endif
24547  if (s1_is_unicode & s2_is_unicode) {
24548  Py_ssize_t length;
24549  int kind;
24550  void *data1, *data2;
24551  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24552  return -1;
24553  length = __Pyx_PyUnicode_GET_LENGTH(s1);
24554  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24555  goto return_ne;
24556  }
24557 #if CYTHON_USE_UNICODE_INTERNALS
24558  {
24559  Py_hash_t hash1, hash2;
24560  #if CYTHON_PEP393_ENABLED
24561  hash1 = ((PyASCIIObject*)s1)->hash;
24562  hash2 = ((PyASCIIObject*)s2)->hash;
24563  #else
24564  hash1 = ((PyUnicodeObject*)s1)->hash;
24565  hash2 = ((PyUnicodeObject*)s2)->hash;
24566  #endif
24567  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24568  goto return_ne;
24569  }
24570  }
24571 #endif
24572  kind = __Pyx_PyUnicode_KIND(s1);
24573  if (kind != __Pyx_PyUnicode_KIND(s2)) {
24574  goto return_ne;
24575  }
24576  data1 = __Pyx_PyUnicode_DATA(s1);
24577  data2 = __Pyx_PyUnicode_DATA(s2);
24578  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24579  goto return_ne;
24580  } else if (length == 1) {
24581  goto return_eq;
24582  } else {
24583  int result = memcmp(data1, data2, (size_t)(length * kind));
24584  #if PY_MAJOR_VERSION < 3
24585  Py_XDECREF(owned_ref);
24586  #endif
24587  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24588  }
24589  } else if ((s1 == Py_None) & s2_is_unicode) {
24590  goto return_ne;
24591  } else if ((s2 == Py_None) & s1_is_unicode) {
24592  goto return_ne;
24593  } else {
24594  int result;
24595  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24596  #if PY_MAJOR_VERSION < 3
24597  Py_XDECREF(owned_ref);
24598  #endif
24599  if (!py_result)
24600  return -1;
24601  result = __Pyx_PyObject_IsTrue(py_result);
24602  Py_DECREF(py_result);
24603  return result;
24604  }
24605 return_eq:
24606  #if PY_MAJOR_VERSION < 3
24607  Py_XDECREF(owned_ref);
24608  #endif
24609  return (equals == Py_EQ);
24610 return_ne:
24611  #if PY_MAJOR_VERSION < 3
24612  Py_XDECREF(owned_ref);
24613  #endif
24614  return (equals == Py_NE);
24615 #endif
24616 }
24617 
24618 /* None */
24619 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24620  Py_ssize_t q = a / b;
24621  Py_ssize_t r = a - q*b;
24622  q -= ((r != 0) & ((r ^ b) < 0));
24623  return q;
24624 }
24625 
24626 /* GetAttr */
24627 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24628 #if CYTHON_USE_TYPE_SLOTS
24629 #if PY_MAJOR_VERSION >= 3
24630  if (likely(PyUnicode_Check(n)))
24631 #else
24632  if (likely(PyString_Check(n)))
24633 #endif
24634  return __Pyx_PyObject_GetAttrStr(o, n);
24635 #endif
24636  return PyObject_GetAttr(o, n);
24637 }
24638 
24639 /* GetItemInt */
24640 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24641  PyObject *r;
24642  if (!j) return NULL;
24643  r = PyObject_GetItem(o, j);
24644  Py_DECREF(j);
24645  return r;
24646 }
24647 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24648  CYTHON_NCP_UNUSED int wraparound,
24649  CYTHON_NCP_UNUSED int boundscheck) {
24650 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24651  Py_ssize_t wrapped_i = i;
24652  if (wraparound & unlikely(i < 0)) {
24653  wrapped_i += PyList_GET_SIZE(o);
24654  }
24655  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24656  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24657  Py_INCREF(r);
24658  return r;
24659  }
24660  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24661 #else
24662  return PySequence_GetItem(o, i);
24663 #endif
24664 }
24665 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24666  CYTHON_NCP_UNUSED int wraparound,
24667  CYTHON_NCP_UNUSED int boundscheck) {
24668 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24669  Py_ssize_t wrapped_i = i;
24670  if (wraparound & unlikely(i < 0)) {
24671  wrapped_i += PyTuple_GET_SIZE(o);
24672  }
24673  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24674  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24675  Py_INCREF(r);
24676  return r;
24677  }
24678  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24679 #else
24680  return PySequence_GetItem(o, i);
24681 #endif
24682 }
24683 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24684  CYTHON_NCP_UNUSED int wraparound,
24685  CYTHON_NCP_UNUSED int boundscheck) {
24686 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24687  if (is_list || PyList_CheckExact(o)) {
24688  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24689  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24690  PyObject *r = PyList_GET_ITEM(o, n);
24691  Py_INCREF(r);
24692  return r;
24693  }
24694  }
24695  else if (PyTuple_CheckExact(o)) {
24696  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24697  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24698  PyObject *r = PyTuple_GET_ITEM(o, n);
24699  Py_INCREF(r);
24700  return r;
24701  }
24702  } else {
24703  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24704  if (likely(m && m->sq_item)) {
24705  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24706  Py_ssize_t l = m->sq_length(o);
24707  if (likely(l >= 0)) {
24708  i += l;
24709  } else {
24710  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24711  return NULL;
24712  PyErr_Clear();
24713  }
24714  }
24715  return m->sq_item(o, i);
24716  }
24717  }
24718 #else
24719  if (is_list || PySequence_Check(o)) {
24720  return PySequence_GetItem(o, i);
24721  }
24722 #endif
24723  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24724 }
24725 
24726 /* ObjectGetItem */
24727 #if CYTHON_USE_TYPE_SLOTS
24728 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24729  PyObject *runerr;
24730  Py_ssize_t key_value;
24731  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24732  if (unlikely(!(m && m->sq_item))) {
24733  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24734  return NULL;
24735  }
24736  key_value = __Pyx_PyIndex_AsSsize_t(index);
24737  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24738  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24739  }
24740  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24741  PyErr_Clear();
24742  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24743  }
24744  return NULL;
24745 }
24746 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24747  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24748  if (likely(m && m->mp_subscript)) {
24749  return m->mp_subscript(obj, key);
24750  }
24751  return __Pyx_PyObject_GetIndex(obj, key);
24752 }
24753 #endif
24754 
24755 /* decode_c_string */
24756 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24757  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24758  const char* encoding, const char* errors,
24759  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
24760  Py_ssize_t length;
24761  if (unlikely((start < 0) | (stop < 0))) {
24762  size_t slen = strlen(cstring);
24763  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
24764  PyErr_SetString(PyExc_OverflowError,
24765  "c-string too long to convert to Python");
24766  return NULL;
24767  }
24768  length = (Py_ssize_t) slen;
24769  if (start < 0) {
24770  start += length;
24771  if (start < 0)
24772  start = 0;
24773  }
24774  if (stop < 0)
24775  stop += length;
24776  }
24777  if (unlikely(stop <= start))
24778  return __Pyx_NewRef(__pyx_empty_unicode);
24779  length = stop - start;
24780  cstring += start;
24781  if (decode_func) {
24782  return decode_func(cstring, length, errors);
24783  } else {
24784  return PyUnicode_Decode(cstring, length, encoding, errors);
24785  }
24786 }
24787 
24788 /* GetAttr3 */
24789 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24790  __Pyx_PyThreadState_declare
24791  __Pyx_PyThreadState_assign
24792  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24793  return NULL;
24794  __Pyx_PyErr_Clear();
24795  Py_INCREF(d);
24796  return d;
24797 }
24798 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24799  PyObject *r = __Pyx_GetAttr(o, n);
24800  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24801 }
24802 
24803 /* PyDictVersioning */
24804 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24805 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24806  PyObject *dict = Py_TYPE(obj)->tp_dict;
24807  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24808 }
24809 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24810  PyObject **dictptr = NULL;
24811  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24812  if (offset) {
24813 #if CYTHON_COMPILING_IN_CPYTHON
24814  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24815 #else
24816  dictptr = _PyObject_GetDictPtr(obj);
24817 #endif
24818  }
24819  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24820 }
24821 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24822  PyObject *dict = Py_TYPE(obj)->tp_dict;
24823  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24824  return 0;
24825  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24826 }
24827 #endif
24828 
24829 /* GetModuleGlobalName */
24830 #if CYTHON_USE_DICT_VERSIONS
24831 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24832 #else
24833 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24834 #endif
24835 {
24836  PyObject *result;
24837 #if !CYTHON_AVOID_BORROWED_REFS
24838 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24839  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24840  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24841  if (likely(result)) {
24842  return __Pyx_NewRef(result);
24843  } else if (unlikely(PyErr_Occurred())) {
24844  return NULL;
24845  }
24846 #else
24847  result = PyDict_GetItem(__pyx_d, name);
24848  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24849  if (likely(result)) {
24850  return __Pyx_NewRef(result);
24851  }
24852 #endif
24853 #else
24854  result = PyObject_GetItem(__pyx_d, name);
24855  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24856  if (likely(result)) {
24857  return __Pyx_NewRef(result);
24858  }
24859  PyErr_Clear();
24860 #endif
24861  return __Pyx_GetBuiltinName(name);
24862 }
24863 
24864 /* RaiseTooManyValuesToUnpack */
24865 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24866  PyErr_Format(PyExc_ValueError,
24867  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24868 }
24869 
24870 /* RaiseNeedMoreValuesToUnpack */
24871 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24872  PyErr_Format(PyExc_ValueError,
24873  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24874  index, (index == 1) ? "" : "s");
24875 }
24876 
24877 /* RaiseNoneIterError */
24878 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24879  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24880 }
24881 
24882 /* SwapException */
24883 #if CYTHON_FAST_THREAD_STATE
24884 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24885  PyObject *tmp_type, *tmp_value, *tmp_tb;
24886  #if CYTHON_USE_EXC_INFO_STACK
24887  _PyErr_StackItem *exc_info = tstate->exc_info;
24888  tmp_type = exc_info->exc_type;
24889  tmp_value = exc_info->exc_value;
24890  tmp_tb = exc_info->exc_traceback;
24891  exc_info->exc_type = *type;
24892  exc_info->exc_value = *value;
24893  exc_info->exc_traceback = *tb;
24894  #else
24895  tmp_type = tstate->exc_type;
24896  tmp_value = tstate->exc_value;
24897  tmp_tb = tstate->exc_traceback;
24898  tstate->exc_type = *type;
24899  tstate->exc_value = *value;
24900  tstate->exc_traceback = *tb;
24901  #endif
24902  *type = tmp_type;
24903  *value = tmp_value;
24904  *tb = tmp_tb;
24905 }
24906 #else
24907 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
24908  PyObject *tmp_type, *tmp_value, *tmp_tb;
24909  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
24910  PyErr_SetExcInfo(*type, *value, *tb);
24911  *type = tmp_type;
24912  *value = tmp_value;
24913  *tb = tmp_tb;
24914 }
24915 #endif
24916 
24917 /* Import */
24918 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
24919  PyObject *empty_list = 0;
24920  PyObject *module = 0;
24921  PyObject *global_dict = 0;
24922  PyObject *empty_dict = 0;
24923  PyObject *list;
24924  #if PY_MAJOR_VERSION < 3
24925  PyObject *py_import;
24926  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24927  if (!py_import)
24928  goto bad;
24929  #endif
24930  if (from_list)
24931  list = from_list;
24932  else {
24933  empty_list = PyList_New(0);
24934  if (!empty_list)
24935  goto bad;
24936  list = empty_list;
24937  }
24938  global_dict = PyModule_GetDict(__pyx_m);
24939  if (!global_dict)
24940  goto bad;
24941  empty_dict = PyDict_New();
24942  if (!empty_dict)
24943  goto bad;
24944  {
24945  #if PY_MAJOR_VERSION >= 3
24946  if (level == -1) {
24947  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24948  module = PyImport_ImportModuleLevelObject(
24949  name, global_dict, empty_dict, list, 1);
24950  if (!module) {
24951  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24952  goto bad;
24953  PyErr_Clear();
24954  }
24955  }
24956  level = 0;
24957  }
24958  #endif
24959  if (!module) {
24960  #if PY_MAJOR_VERSION < 3
24961  PyObject *py_level = PyInt_FromLong(level);
24962  if (!py_level)
24963  goto bad;
24964  module = PyObject_CallFunctionObjArgs(py_import,
24965  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24966  Py_DECREF(py_level);
24967  #else
24968  module = PyImport_ImportModuleLevelObject(
24969  name, global_dict, empty_dict, list, level);
24970  #endif
24971  }
24972  }
24973 bad:
24974  #if PY_MAJOR_VERSION < 3
24975  Py_XDECREF(py_import);
24976  #endif
24977  Py_XDECREF(empty_list);
24978  Py_XDECREF(empty_dict);
24979  return module;
24980 }
24981 
24982 /* FastTypeChecks */
24983 #if CYTHON_COMPILING_IN_CPYTHON
24984 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24985  while (a) {
24986  a = a->tp_base;
24987  if (a == b)
24988  return 1;
24989  }
24990  return b == &PyBaseObject_Type;
24991 }
24992 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24993  PyObject *mro;
24994  if (a == b) return 1;
24995  mro = a->tp_mro;
24996  if (likely(mro)) {
24997  Py_ssize_t i, n;
24998  n = PyTuple_GET_SIZE(mro);
24999  for (i = 0; i < n; i++) {
25000  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25001  return 1;
25002  }
25003  return 0;
25004  }
25005  return __Pyx_InBases(a, b);
25006 }
25007 #if PY_MAJOR_VERSION == 2
25008 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25009  PyObject *exception, *value, *tb;
25010  int res;
25011  __Pyx_PyThreadState_declare
25012  __Pyx_PyThreadState_assign
25013  __Pyx_ErrFetch(&exception, &value, &tb);
25014  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25015  if (unlikely(res == -1)) {
25016  PyErr_WriteUnraisable(err);
25017  res = 0;
25018  }
25019  if (!res) {
25020  res = PyObject_IsSubclass(err, exc_type2);
25021  if (unlikely(res == -1)) {
25022  PyErr_WriteUnraisable(err);
25023  res = 0;
25024  }
25025  }
25026  __Pyx_ErrRestore(exception, value, tb);
25027  return res;
25028 }
25029 #else
25030 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25031  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25032  if (!res) {
25033  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25034  }
25035  return res;
25036 }
25037 #endif
25038 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25039  Py_ssize_t i, n;
25040  assert(PyExceptionClass_Check(exc_type));
25041  n = PyTuple_GET_SIZE(tuple);
25042 #if PY_MAJOR_VERSION >= 3
25043  for (i=0; i<n; i++) {
25044  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25045  }
25046 #endif
25047  for (i=0; i<n; i++) {
25048  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25049  #if PY_MAJOR_VERSION < 3
25050  if (likely(exc_type == t)) return 1;
25051  #endif
25052  if (likely(PyExceptionClass_Check(t))) {
25053  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25054  } else {
25055  }
25056  }
25057  return 0;
25058 }
25059 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25060  if (likely(err == exc_type)) return 1;
25061  if (likely(PyExceptionClass_Check(err))) {
25062  if (likely(PyExceptionClass_Check(exc_type))) {
25063  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25064  } else if (likely(PyTuple_Check(exc_type))) {
25065  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25066  } else {
25067  }
25068  }
25069  return PyErr_GivenExceptionMatches(err, exc_type);
25070 }
25071 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25072  assert(PyExceptionClass_Check(exc_type1));
25073  assert(PyExceptionClass_Check(exc_type2));
25074  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25075  if (likely(PyExceptionClass_Check(err))) {
25076  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25077  }
25078  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25079 }
25080 #endif
25081 
25082 /* PyIntBinop */
25083 #if !CYTHON_COMPILING_IN_PYPY
25084 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
25085  (void)inplace;
25086  (void)zerodivision_check;
25087  #if PY_MAJOR_VERSION < 3
25088  if (likely(PyInt_CheckExact(op1))) {
25089  const long b = intval;
25090  long x;
25091  long a = PyInt_AS_LONG(op1);
25092  x = (long)((unsigned long)a + b);
25093  if (likely((x^a) >= 0 || (x^b) >= 0))
25094  return PyInt_FromLong(x);
25095  return PyLong_Type.tp_as_number->nb_add(op1, op2);
25096  }
25097  #endif
25098  #if CYTHON_USE_PYLONG_INTERNALS
25099  if (likely(PyLong_CheckExact(op1))) {
25100  const long b = intval;
25101  long a, x;
25102 #ifdef HAVE_LONG_LONG
25103  const PY_LONG_LONG llb = intval;
25104  PY_LONG_LONG lla, llx;
25105 #endif
25106  const digit* digits = ((PyLongObject*)op1)->ob_digit;
25107  const Py_ssize_t size = Py_SIZE(op1);
25108  if (likely(__Pyx_sst_abs(size) <= 1)) {
25109  a = likely(size) ? digits[0] : 0;
25110  if (size == -1) a = -a;
25111  } else {
25112  switch (size) {
25113  case -2:
25114  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25115  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25116  break;
25117 #ifdef HAVE_LONG_LONG
25118  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25119  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25120  goto long_long;
25121 #endif
25122  }
25123  CYTHON_FALLTHROUGH;
25124  case 2:
25125  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25126  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25127  break;
25128 #ifdef HAVE_LONG_LONG
25129  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25130  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25131  goto long_long;
25132 #endif
25133  }
25134  CYTHON_FALLTHROUGH;
25135  case -3:
25136  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25137  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25138  break;
25139 #ifdef HAVE_LONG_LONG
25140  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25141  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25142  goto long_long;
25143 #endif
25144  }
25145  CYTHON_FALLTHROUGH;
25146  case 3:
25147  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25148  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25149  break;
25150 #ifdef HAVE_LONG_LONG
25151  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25152  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25153  goto long_long;
25154 #endif
25155  }
25156  CYTHON_FALLTHROUGH;
25157  case -4:
25158  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25159  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25160  break;
25161 #ifdef HAVE_LONG_LONG
25162  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25163  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25164  goto long_long;
25165 #endif
25166  }
25167  CYTHON_FALLTHROUGH;
25168  case 4:
25169  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25170  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25171  break;
25172 #ifdef HAVE_LONG_LONG
25173  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25174  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25175  goto long_long;
25176 #endif
25177  }
25178  CYTHON_FALLTHROUGH;
25179  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
25180  }
25181  }
25182  x = a + b;
25183  return PyLong_FromLong(x);
25184 #ifdef HAVE_LONG_LONG
25185  long_long:
25186  llx = lla + llb;
25187  return PyLong_FromLongLong(llx);
25188 #endif
25189 
25190 
25191  }
25192  #endif
25193  if (PyFloat_CheckExact(op1)) {
25194  const long b = intval;
25195  double a = PyFloat_AS_DOUBLE(op1);
25196  double result;
25197  PyFPE_START_PROTECT("add", return NULL)
25198  result = ((double)a) + (double)b;
25199  PyFPE_END_PROTECT(result)
25200  return PyFloat_FromDouble(result);
25201  }
25202  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25203 }
25204 #endif
25205 
25206 /* None */
25207 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25208  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25209 }
25210 
25211 /* None */
25212 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25213  long q = a / b;
25214  long r = a - q*b;
25215  q -= ((r != 0) & ((r ^ b) < 0));
25216  return q;
25217 }
25218 
25219 /* ImportFrom */
25220 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25221  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25222  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25223  PyErr_Format(PyExc_ImportError,
25224  #if PY_MAJOR_VERSION < 3
25225  "cannot import name %.230s", PyString_AS_STRING(name));
25226  #else
25227  "cannot import name %S", name);
25228  #endif
25229  }
25230  return value;
25231 }
25232 
25233 /* HasAttr */
25234 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25235  PyObject *r;
25236  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25237  PyErr_SetString(PyExc_TypeError,
25238  "hasattr(): attribute name must be string");
25239  return -1;
25240  }
25241  r = __Pyx_GetAttr(o, n);
25242  if (unlikely(!r)) {
25243  PyErr_Clear();
25244  return 0;
25245  } else {
25246  Py_DECREF(r);
25247  return 1;
25248  }
25249 }
25250 
25251 /* PyObject_GenericGetAttrNoDict */
25252 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25253 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25254  PyErr_Format(PyExc_AttributeError,
25255 #if PY_MAJOR_VERSION >= 3
25256  "'%.50s' object has no attribute '%U'",
25257  tp->tp_name, attr_name);
25258 #else
25259  "'%.50s' object has no attribute '%.400s'",
25260  tp->tp_name, PyString_AS_STRING(attr_name));
25261 #endif
25262  return NULL;
25263 }
25264 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25265  PyObject *descr;
25266  PyTypeObject *tp = Py_TYPE(obj);
25267  if (unlikely(!PyString_Check(attr_name))) {
25268  return PyObject_GenericGetAttr(obj, attr_name);
25269  }
25270  assert(!tp->tp_dictoffset);
25271  descr = _PyType_Lookup(tp, attr_name);
25272  if (unlikely(!descr)) {
25273  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25274  }
25275  Py_INCREF(descr);
25276  #if PY_MAJOR_VERSION < 3
25277  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25278  #endif
25279  {
25280  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25281  if (unlikely(f)) {
25282  PyObject *res = f(descr, obj, (PyObject *)tp);
25283  Py_DECREF(descr);
25284  return res;
25285  }
25286  }
25287  return descr;
25288 }
25289 #endif
25290 
25291 /* PyObject_GenericGetAttr */
25292 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25293 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25294  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25295  return PyObject_GenericGetAttr(obj, attr_name);
25296  }
25297  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25298 }
25299 #endif
25300 
25301 /* PyObjectGetAttrStrNoError */
25302 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25303  __Pyx_PyThreadState_declare
25304  __Pyx_PyThreadState_assign
25305  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25306  __Pyx_PyErr_Clear();
25307 }
25308 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25309  PyObject *result;
25310 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25311  PyTypeObject* tp = Py_TYPE(obj);
25312  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25313  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25314  }
25315 #endif
25316  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25317  if (unlikely(!result)) {
25318  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25319  }
25320  return result;
25321 }
25322 
25323 /* SetupReduce */
25324 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25325  int ret;
25326  PyObject *name_attr;
25327  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25328  if (likely(name_attr)) {
25329  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25330  } else {
25331  ret = -1;
25332  }
25333  if (unlikely(ret < 0)) {
25334  PyErr_Clear();
25335  ret = 0;
25336  }
25337  Py_XDECREF(name_attr);
25338  return ret;
25339 }
25340 static int __Pyx_setup_reduce(PyObject* type_obj) {
25341  int ret = 0;
25342  PyObject *object_reduce = NULL;
25343  PyObject *object_reduce_ex = NULL;
25344  PyObject *reduce = NULL;
25345  PyObject *reduce_ex = NULL;
25346  PyObject *reduce_cython = NULL;
25347  PyObject *setstate = NULL;
25348  PyObject *setstate_cython = NULL;
25349 #if CYTHON_USE_PYTYPE_LOOKUP
25350  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25351 #else
25352  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25353 #endif
25354 #if CYTHON_USE_PYTYPE_LOOKUP
25355  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25356 #else
25357  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25358 #endif
25359  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25360  if (reduce_ex == object_reduce_ex) {
25361 #if CYTHON_USE_PYTYPE_LOOKUP
25362  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25363 #else
25364  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25365 #endif
25366  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25367  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25368  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25369  if (likely(reduce_cython)) {
25370  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25371  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25372  } else if (reduce == object_reduce || PyErr_Occurred()) {
25373  goto __PYX_BAD;
25374  }
25375  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25376  if (!setstate) PyErr_Clear();
25377  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25378  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25379  if (likely(setstate_cython)) {
25380  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25381  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25382  } else if (!setstate || PyErr_Occurred()) {
25383  goto __PYX_BAD;
25384  }
25385  }
25386  PyType_Modified((PyTypeObject*)type_obj);
25387  }
25388  }
25389  goto __PYX_GOOD;
25390 __PYX_BAD:
25391  if (!PyErr_Occurred())
25392  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25393  ret = -1;
25394 __PYX_GOOD:
25395 #if !CYTHON_USE_PYTYPE_LOOKUP
25396  Py_XDECREF(object_reduce);
25397  Py_XDECREF(object_reduce_ex);
25398 #endif
25399  Py_XDECREF(reduce);
25400  Py_XDECREF(reduce_ex);
25401  Py_XDECREF(reduce_cython);
25402  Py_XDECREF(setstate);
25403  Py_XDECREF(setstate_cython);
25404  return ret;
25405 }
25406 
25407 /* SetVTable */
25408 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25409 #if PY_VERSION_HEX >= 0x02070000
25410  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25411 #else
25412  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25413 #endif
25414  if (!ob)
25415  goto bad;
25416  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25417  goto bad;
25418  Py_DECREF(ob);
25419  return 0;
25420 bad:
25421  Py_XDECREF(ob);
25422  return -1;
25423 }
25424 
25425 /* TypeImport */
25426 #ifndef __PYX_HAVE_RT_ImportType
25427 #define __PYX_HAVE_RT_ImportType
25428 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25429  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25430 {
25431  PyObject *result = 0;
25432  char warning[200];
25433  Py_ssize_t basicsize;
25434 #ifdef Py_LIMITED_API
25435  PyObject *py_basicsize;
25436 #endif
25437  result = PyObject_GetAttrString(module, class_name);
25438  if (!result)
25439  goto bad;
25440  if (!PyType_Check(result)) {
25441  PyErr_Format(PyExc_TypeError,
25442  "%.200s.%.200s is not a type object",
25443  module_name, class_name);
25444  goto bad;
25445  }
25446 #ifndef Py_LIMITED_API
25447  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25448 #else
25449  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25450  if (!py_basicsize)
25451  goto bad;
25452  basicsize = PyLong_AsSsize_t(py_basicsize);
25453  Py_DECREF(py_basicsize);
25454  py_basicsize = 0;
25455  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25456  goto bad;
25457 #endif
25458  if ((size_t)basicsize < size) {
25459  PyErr_Format(PyExc_ValueError,
25460  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25461  "Expected %zd from C header, got %zd from PyObject",
25462  module_name, class_name, size, basicsize);
25463  goto bad;
25464  }
25465  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25466  PyErr_Format(PyExc_ValueError,
25467  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25468  "Expected %zd from C header, got %zd from PyObject",
25469  module_name, class_name, size, basicsize);
25470  goto bad;
25471  }
25472  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25473  PyOS_snprintf(warning, sizeof(warning),
25474  "%s.%s size changed, may indicate binary incompatibility. "
25475  "Expected %zd from C header, got %zd from PyObject",
25476  module_name, class_name, size, basicsize);
25477  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25478  }
25479  return (PyTypeObject *)result;
25480 bad:
25481  Py_XDECREF(result);
25482  return NULL;
25483 }
25484 #endif
25485 
25486 /* CalculateMetaclass */
25487 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
25488  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
25489  for (i=0; i < nbases; i++) {
25490  PyTypeObject *tmptype;
25491  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
25492  tmptype = Py_TYPE(tmp);
25493 #if PY_MAJOR_VERSION < 3
25494  if (tmptype == &PyClass_Type)
25495  continue;
25496 #endif
25497  if (!metaclass) {
25498  metaclass = tmptype;
25499  continue;
25500  }
25501  if (PyType_IsSubtype(metaclass, tmptype))
25502  continue;
25503  if (PyType_IsSubtype(tmptype, metaclass)) {
25504  metaclass = tmptype;
25505  continue;
25506  }
25507  PyErr_SetString(PyExc_TypeError,
25508  "metaclass conflict: "
25509  "the metaclass of a derived class "
25510  "must be a (non-strict) subclass "
25511  "of the metaclasses of all its bases");
25512  return NULL;
25513  }
25514  if (!metaclass) {
25515 #if PY_MAJOR_VERSION < 3
25516  metaclass = &PyClass_Type;
25517 #else
25518  metaclass = &PyType_Type;
25519 #endif
25520  }
25521  Py_INCREF((PyObject*) metaclass);
25522  return (PyObject*) metaclass;
25523 }
25524 
25525 /* FetchCommonType */
25526 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25527  PyObject* fake_module;
25528  PyTypeObject* cached_type = NULL;
25529  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25530  if (!fake_module) return NULL;
25531  Py_INCREF(fake_module);
25532  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25533  if (cached_type) {
25534  if (!PyType_Check((PyObject*)cached_type)) {
25535  PyErr_Format(PyExc_TypeError,
25536  "Shared Cython type %.200s is not a type object",
25537  type->tp_name);
25538  goto bad;
25539  }
25540  if (cached_type->tp_basicsize != type->tp_basicsize) {
25541  PyErr_Format(PyExc_TypeError,
25542  "Shared Cython type %.200s has the wrong size, try recompiling",
25543  type->tp_name);
25544  goto bad;
25545  }
25546  } else {
25547  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25548  PyErr_Clear();
25549  if (PyType_Ready(type) < 0) goto bad;
25550  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25551  goto bad;
25552  Py_INCREF(type);
25553  cached_type = type;
25554  }
25555 done:
25556  Py_DECREF(fake_module);
25557  return cached_type;
25558 bad:
25559  Py_XDECREF(cached_type);
25560  cached_type = NULL;
25561  goto done;
25562 }
25563 
25564 /* CythonFunctionShared */
25565 #include <structmember.h>
25566 static PyObject *
25567 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25568 {
25569  if (unlikely(op->func_doc == NULL)) {
25570  if (op->func.m_ml->ml_doc) {
25571 #if PY_MAJOR_VERSION >= 3
25572  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25573 #else
25574  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25575 #endif
25576  if (unlikely(op->func_doc == NULL))
25577  return NULL;
25578  } else {
25579  Py_INCREF(Py_None);
25580  return Py_None;
25581  }
25582  }
25583  Py_INCREF(op->func_doc);
25584  return op->func_doc;
25585 }
25586 static int
25587 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25588 {
25589  PyObject *tmp = op->func_doc;
25590  if (value == NULL) {
25591  value = Py_None;
25592  }
25593  Py_INCREF(value);
25594  op->func_doc = value;
25595  Py_XDECREF(tmp);
25596  return 0;
25597 }
25598 static PyObject *
25599 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25600 {
25601  if (unlikely(op->func_name == NULL)) {
25602 #if PY_MAJOR_VERSION >= 3
25603  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25604 #else
25605  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25606 #endif
25607  if (unlikely(op->func_name == NULL))
25608  return NULL;
25609  }
25610  Py_INCREF(op->func_name);
25611  return op->func_name;
25612 }
25613 static int
25614 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25615 {
25616  PyObject *tmp;
25617 #if PY_MAJOR_VERSION >= 3
25618  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25619 #else
25620  if (unlikely(value == NULL || !PyString_Check(value)))
25621 #endif
25622  {
25623  PyErr_SetString(PyExc_TypeError,
25624  "__name__ must be set to a string object");
25625  return -1;
25626  }
25627  tmp = op->func_name;
25628  Py_INCREF(value);
25629  op->func_name = value;
25630  Py_XDECREF(tmp);
25631  return 0;
25632 }
25633 static PyObject *
25634 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25635 {
25636  Py_INCREF(op->func_qualname);
25637  return op->func_qualname;
25638 }
25639 static int
25640 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25641 {
25642  PyObject *tmp;
25643 #if PY_MAJOR_VERSION >= 3
25644  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25645 #else
25646  if (unlikely(value == NULL || !PyString_Check(value)))
25647 #endif
25648  {
25649  PyErr_SetString(PyExc_TypeError,
25650  "__qualname__ must be set to a string object");
25651  return -1;
25652  }
25653  tmp = op->func_qualname;
25654  Py_INCREF(value);
25655  op->func_qualname = value;
25656  Py_XDECREF(tmp);
25657  return 0;
25658 }
25659 static PyObject *
25660 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25661 {
25662  PyObject *self;
25663  self = m->func_closure;
25664  if (self == NULL)
25665  self = Py_None;
25666  Py_INCREF(self);
25667  return self;
25668 }
25669 static PyObject *
25670 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25671 {
25672  if (unlikely(op->func_dict == NULL)) {
25673  op->func_dict = PyDict_New();
25674  if (unlikely(op->func_dict == NULL))
25675  return NULL;
25676  }
25677  Py_INCREF(op->func_dict);
25678  return op->func_dict;
25679 }
25680 static int
25681 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25682 {
25683  PyObject *tmp;
25684  if (unlikely(value == NULL)) {
25685  PyErr_SetString(PyExc_TypeError,
25686  "function's dictionary may not be deleted");
25687  return -1;
25688  }
25689  if (unlikely(!PyDict_Check(value))) {
25690  PyErr_SetString(PyExc_TypeError,
25691  "setting function's dictionary to a non-dict");
25692  return -1;
25693  }
25694  tmp = op->func_dict;
25695  Py_INCREF(value);
25696  op->func_dict = value;
25697  Py_XDECREF(tmp);
25698  return 0;
25699 }
25700 static PyObject *
25701 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25702 {
25703  Py_INCREF(op->func_globals);
25704  return op->func_globals;
25705 }
25706 static PyObject *
25707 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25708 {
25709  Py_INCREF(Py_None);
25710  return Py_None;
25711 }
25712 static PyObject *
25713 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25714 {
25715  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25716  Py_INCREF(result);
25717  return result;
25718 }
25719 static int
25720 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25721  int result = 0;
25722  PyObject *res = op->defaults_getter((PyObject *) op);
25723  if (unlikely(!res))
25724  return -1;
25725  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25726  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25727  Py_INCREF(op->defaults_tuple);
25728  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25729  Py_INCREF(op->defaults_kwdict);
25730  #else
25731  op->defaults_tuple = PySequence_ITEM(res, 0);
25732  if (unlikely(!op->defaults_tuple)) result = -1;
25733  else {
25734  op->defaults_kwdict = PySequence_ITEM(res, 1);
25735  if (unlikely(!op->defaults_kwdict)) result = -1;
25736  }
25737  #endif
25738  Py_DECREF(res);
25739  return result;
25740 }
25741 static int
25742 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25743  PyObject* tmp;
25744  if (!value) {
25745  value = Py_None;
25746  } else if (value != Py_None && !PyTuple_Check(value)) {
25747  PyErr_SetString(PyExc_TypeError,
25748  "__defaults__ must be set to a tuple object");
25749  return -1;
25750  }
25751  Py_INCREF(value);
25752  tmp = op->defaults_tuple;
25753  op->defaults_tuple = value;
25754  Py_XDECREF(tmp);
25755  return 0;
25756 }
25757 static PyObject *
25758 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25759  PyObject* result = op->defaults_tuple;
25760  if (unlikely(!result)) {
25761  if (op->defaults_getter) {
25762  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25763  result = op->defaults_tuple;
25764  } else {
25765  result = Py_None;
25766  }
25767  }
25768  Py_INCREF(result);
25769  return result;
25770 }
25771 static int
25772 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25773  PyObject* tmp;
25774  if (!value) {
25775  value = Py_None;
25776  } else if (value != Py_None && !PyDict_Check(value)) {
25777  PyErr_SetString(PyExc_TypeError,
25778  "__kwdefaults__ must be set to a dict object");
25779  return -1;
25780  }
25781  Py_INCREF(value);
25782  tmp = op->defaults_kwdict;
25783  op->defaults_kwdict = value;
25784  Py_XDECREF(tmp);
25785  return 0;
25786 }
25787 static PyObject *
25788 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25789  PyObject* result = op->defaults_kwdict;
25790  if (unlikely(!result)) {
25791  if (op->defaults_getter) {
25792  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25793  result = op->defaults_kwdict;
25794  } else {
25795  result = Py_None;
25796  }
25797  }
25798  Py_INCREF(result);
25799  return result;
25800 }
25801 static int
25802 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25803  PyObject* tmp;
25804  if (!value || value == Py_None) {
25805  value = NULL;
25806  } else if (!PyDict_Check(value)) {
25807  PyErr_SetString(PyExc_TypeError,
25808  "__annotations__ must be set to a dict object");
25809  return -1;
25810  }
25811  Py_XINCREF(value);
25812  tmp = op->func_annotations;
25813  op->func_annotations = value;
25814  Py_XDECREF(tmp);
25815  return 0;
25816 }
25817 static PyObject *
25818 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25819  PyObject* result = op->func_annotations;
25820  if (unlikely(!result)) {
25821  result = PyDict_New();
25822  if (unlikely(!result)) return NULL;
25823  op->func_annotations = result;
25824  }
25825  Py_INCREF(result);
25826  return result;
25827 }
25828 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25829  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25830  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25831  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25832  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25833  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25834  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25835  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25836  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25837  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25838  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25839  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25840  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25841  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25842  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25843  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25844  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25845  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25846  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25847  {0, 0, 0, 0, 0}
25848 };
25849 static PyMemberDef __pyx_CyFunction_members[] = {
25850  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25851  {0, 0, 0, 0, 0}
25852 };
25853 static PyObject *
25854 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25855 {
25856 #if PY_MAJOR_VERSION >= 3
25857  Py_INCREF(m->func_qualname);
25858  return m->func_qualname;
25859 #else
25860  return PyString_FromString(m->func.m_ml->ml_name);
25861 #endif
25862 }
25863 static PyMethodDef __pyx_CyFunction_methods[] = {
25864  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25865  {0, 0, 0, 0}
25866 };
25867 #if PY_VERSION_HEX < 0x030500A0
25868 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25869 #else
25870 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25871 #endif
25872 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
25873  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25874  if (unlikely(op == NULL))
25875  return NULL;
25876  op->flags = flags;
25877  __Pyx_CyFunction_weakreflist(op) = NULL;
25878  op->func.m_ml = ml;
25879  op->func.m_self = (PyObject *) op;
25880  Py_XINCREF(closure);
25881  op->func_closure = closure;
25882  Py_XINCREF(module);
25883  op->func.m_module = module;
25884  op->func_dict = NULL;
25885  op->func_name = NULL;
25886  Py_INCREF(qualname);
25887  op->func_qualname = qualname;
25888  op->func_doc = NULL;
25889  op->func_classobj = NULL;
25890  op->func_globals = globals;
25891  Py_INCREF(op->func_globals);
25892  Py_XINCREF(code);
25893  op->func_code = code;
25894  op->defaults_pyobjects = 0;
25895  op->defaults_size = 0;
25896  op->defaults = NULL;
25897  op->defaults_tuple = NULL;
25898  op->defaults_kwdict = NULL;
25899  op->defaults_getter = NULL;
25900  op->func_annotations = NULL;
25901  return (PyObject *) op;
25902 }
25903 static int
25904 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25905 {
25906  Py_CLEAR(m->func_closure);
25907  Py_CLEAR(m->func.m_module);
25908  Py_CLEAR(m->func_dict);
25909  Py_CLEAR(m->func_name);
25910  Py_CLEAR(m->func_qualname);
25911  Py_CLEAR(m->func_doc);
25912  Py_CLEAR(m->func_globals);
25913  Py_CLEAR(m->func_code);
25914  Py_CLEAR(m->func_classobj);
25915  Py_CLEAR(m->defaults_tuple);
25916  Py_CLEAR(m->defaults_kwdict);
25917  Py_CLEAR(m->func_annotations);
25918  if (m->defaults) {
25919  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25920  int i;
25921  for (i = 0; i < m->defaults_pyobjects; i++)
25922  Py_XDECREF(pydefaults[i]);
25923  PyObject_Free(m->defaults);
25924  m->defaults = NULL;
25925  }
25926  return 0;
25927 }
25928 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25929 {
25930  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25931  PyObject_ClearWeakRefs((PyObject *) m);
25932  __Pyx_CyFunction_clear(m);
25933  PyObject_GC_Del(m);
25934 }
25935 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25936 {
25937  PyObject_GC_UnTrack(m);
25938  __Pyx__CyFunction_dealloc(m);
25939 }
25940 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25941 {
25942  Py_VISIT(m->func_closure);
25943  Py_VISIT(m->func.m_module);
25944  Py_VISIT(m->func_dict);
25945  Py_VISIT(m->func_name);
25946  Py_VISIT(m->func_qualname);
25947  Py_VISIT(m->func_doc);
25948  Py_VISIT(m->func_globals);
25949  Py_VISIT(m->func_code);
25950  Py_VISIT(m->func_classobj);
25951  Py_VISIT(m->defaults_tuple);
25952  Py_VISIT(m->defaults_kwdict);
25953  if (m->defaults) {
25954  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25955  int i;
25956  for (i = 0; i < m->defaults_pyobjects; i++)
25957  Py_VISIT(pydefaults[i]);
25958  }
25959  return 0;
25960 }
25961 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25962 {
25963 #if PY_MAJOR_VERSION < 3
25964  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25965  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25966  Py_INCREF(func);
25967  return func;
25968  }
25969  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25970  if (type == NULL)
25971  type = (PyObject *)(Py_TYPE(obj));
25972  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25973  }
25974  if (obj == Py_None)
25975  obj = NULL;
25976 #endif
25977  return __Pyx_PyMethod_New(func, obj, type);
25978 }
25979 static PyObject*
25980 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25981 {
25982 #if PY_MAJOR_VERSION >= 3
25983  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25984  op->func_qualname, (void *)op);
25985 #else
25986  return PyString_FromFormat("<cyfunction %s at %p>",
25987  PyString_AsString(op->func_qualname), (void *)op);
25988 #endif
25989 }
25990 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25991  PyCFunctionObject* f = (PyCFunctionObject*)func;
25992  PyCFunction meth = f->m_ml->ml_meth;
25993  Py_ssize_t size;
25994  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25995  case METH_VARARGS:
25996  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25997  return (*meth)(self, arg);
25998  break;
25999  case METH_VARARGS | METH_KEYWORDS:
26000  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26001  case METH_NOARGS:
26002  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26003  size = PyTuple_GET_SIZE(arg);
26004  if (likely(size == 0))
26005  return (*meth)(self, NULL);
26006  PyErr_Format(PyExc_TypeError,
26007  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26008  f->m_ml->ml_name, size);
26009  return NULL;
26010  }
26011  break;
26012  case METH_O:
26013  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26014  size = PyTuple_GET_SIZE(arg);
26015  if (likely(size == 1)) {
26016  PyObject *result, *arg0;
26017  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26018  arg0 = PyTuple_GET_ITEM(arg, 0);
26019  #else
26020  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26021  #endif
26022  result = (*meth)(self, arg0);
26023  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26024  Py_DECREF(arg0);
26025  #endif
26026  return result;
26027  }
26028  PyErr_Format(PyExc_TypeError,
26029  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26030  f->m_ml->ml_name, size);
26031  return NULL;
26032  }
26033  break;
26034  default:
26035  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26036  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26037  "longer supported!");
26038  return NULL;
26039  }
26040  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26041  f->m_ml->ml_name);
26042  return NULL;
26043 }
26044 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26045  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26046 }
26047 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26048  PyObject *result;
26049  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26050  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26051  Py_ssize_t argc;
26052  PyObject *new_args;
26053  PyObject *self;
26054  argc = PyTuple_GET_SIZE(args);
26055  new_args = PyTuple_GetSlice(args, 1, argc);
26056  if (unlikely(!new_args))
26057  return NULL;
26058  self = PyTuple_GetItem(args, 0);
26059  if (unlikely(!self)) {
26060  Py_DECREF(new_args);
26061  return NULL;
26062  }
26063  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26064  Py_DECREF(new_args);
26065  } else {
26066  result = __Pyx_CyFunction_Call(func, args, kw);
26067  }
26068  return result;
26069 }
26070 static PyTypeObject __pyx_CyFunctionType_type = {
26071  PyVarObject_HEAD_INIT(0, 0)
26072  "cython_function_or_method",
26073  sizeof(__pyx_CyFunctionObject),
26074  0,
26075  (destructor) __Pyx_CyFunction_dealloc,
26076  0,
26077  0,
26078  0,
26079 #if PY_MAJOR_VERSION < 3
26080  0,
26081 #else
26082  0,
26083 #endif
26084  (reprfunc) __Pyx_CyFunction_repr,
26085  0,
26086  0,
26087  0,
26088  0,
26089  __Pyx_CyFunction_CallAsMethod,
26090  0,
26091  0,
26092  0,
26093  0,
26094  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26095  0,
26096  (traverseproc) __Pyx_CyFunction_traverse,
26097  (inquiry) __Pyx_CyFunction_clear,
26098  0,
26099 #if PY_VERSION_HEX < 0x030500A0
26100  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26101 #else
26102  offsetof(PyCFunctionObject, m_weakreflist),
26103 #endif
26104  0,
26105  0,
26106  __pyx_CyFunction_methods,
26107  __pyx_CyFunction_members,
26108  __pyx_CyFunction_getsets,
26109  0,
26110  0,
26111  __Pyx_CyFunction_descr_get,
26112  0,
26113  offsetof(__pyx_CyFunctionObject, func_dict),
26114  0,
26115  0,
26116  0,
26117  0,
26118  0,
26119  0,
26120  0,
26121  0,
26122  0,
26123  0,
26124  0,
26125  0,
26126 #if PY_VERSION_HEX >= 0x030400a1
26127  0,
26128 #endif
26129 #if PY_VERSION_HEX >= 0x030800b1
26130  0,
26131 #endif
26132 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26133  0,
26134 #endif
26135 };
26136 static int __pyx_CyFunction_init(void) {
26137  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26138  if (unlikely(__pyx_CyFunctionType == NULL)) {
26139  return -1;
26140  }
26141  return 0;
26142 }
26143 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26144  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26145  m->defaults = PyObject_Malloc(size);
26146  if (unlikely(!m->defaults))
26147  return PyErr_NoMemory();
26148  memset(m->defaults, 0, size);
26149  m->defaults_pyobjects = pyobjects;
26150  m->defaults_size = size;
26151  return m->defaults;
26152 }
26153 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26154  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26155  m->defaults_tuple = tuple;
26156  Py_INCREF(tuple);
26157 }
26158 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26159  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26160  m->defaults_kwdict = dict;
26161  Py_INCREF(dict);
26162 }
26163 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26164  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26165  m->func_annotations = dict;
26166  Py_INCREF(dict);
26167 }
26168 
26169 /* CythonFunction */
26170 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
26171  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26172  PyObject *op = __Pyx_CyFunction_Init(
26173  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26174  ml, flags, qualname, closure, module, globals, code
26175  );
26176  if (likely(op)) {
26177  PyObject_GC_Track(op);
26178  }
26179  return op;
26180 }
26181 
26182 /* Py3ClassCreate */
26183 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26184  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26185  PyObject *ns;
26186  if (metaclass) {
26187  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26188  if (prep) {
26189  PyObject *pargs = PyTuple_Pack(2, name, bases);
26190  if (unlikely(!pargs)) {
26191  Py_DECREF(prep);
26192  return NULL;
26193  }
26194  ns = PyObject_Call(prep, pargs, mkw);
26195  Py_DECREF(prep);
26196  Py_DECREF(pargs);
26197  } else {
26198  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26199  return NULL;
26200  PyErr_Clear();
26201  ns = PyDict_New();
26202  }
26203  } else {
26204  ns = PyDict_New();
26205  }
26206  if (unlikely(!ns))
26207  return NULL;
26208  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
26209  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
26210  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
26211  return ns;
26212 bad:
26213  Py_DECREF(ns);
26214  return NULL;
26215 }
26216 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26217  PyObject *dict, PyObject *mkw,
26218  int calculate_metaclass, int allow_py2_metaclass) {
26219  PyObject *result, *margs;
26220  PyObject *owned_metaclass = NULL;
26221  if (allow_py2_metaclass) {
26222  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26223  if (owned_metaclass) {
26224  metaclass = owned_metaclass;
26225  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26226  PyErr_Clear();
26227  } else {
26228  return NULL;
26229  }
26230  }
26231  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26232  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26233  Py_XDECREF(owned_metaclass);
26234  if (unlikely(!metaclass))
26235  return NULL;
26236  owned_metaclass = metaclass;
26237  }
26238  margs = PyTuple_Pack(3, name, bases, dict);
26239  if (unlikely(!margs)) {
26240  result = NULL;
26241  } else {
26242  result = PyObject_Call(metaclass, margs, mkw);
26243  Py_DECREF(margs);
26244  }
26245  Py_XDECREF(owned_metaclass);
26246  return result;
26247 }
26248 
26249 /* CLineInTraceback */
26250 #ifndef CYTHON_CLINE_IN_TRACEBACK
26251 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
26252  PyObject *use_cline;
26253  PyObject *ptype, *pvalue, *ptraceback;
26254 #if CYTHON_COMPILING_IN_CPYTHON
26255  PyObject **cython_runtime_dict;
26256 #endif
26257  if (unlikely(!__pyx_cython_runtime)) {
26258  return c_line;
26259  }
26260  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26261 #if CYTHON_COMPILING_IN_CPYTHON
26262  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26263  if (likely(cython_runtime_dict)) {
26264  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26265  use_cline, *cython_runtime_dict,
26266  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26267  } else
26268 #endif
26269  {
26270  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26271  if (use_cline_obj) {
26272  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26273  Py_DECREF(use_cline_obj);
26274  } else {
26275  PyErr_Clear();
26276  use_cline = NULL;
26277  }
26278  }
26279  if (!use_cline) {
26280  c_line = 0;
26281  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26282  }
26283  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26284  c_line = 0;
26285  }
26286  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26287  return c_line;
26288 }
26289 #endif
26290 
26291 /* CodeObjectCache */
26292 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26293  int start = 0, mid = 0, end = count - 1;
26294  if (end >= 0 && code_line > entries[end].code_line) {
26295  return count;
26296  }
26297  while (start < end) {
26298  mid = start + (end - start) / 2;
26299  if (code_line < entries[mid].code_line) {
26300  end = mid;
26301  } else if (code_line > entries[mid].code_line) {
26302  start = mid + 1;
26303  } else {
26304  return mid;
26305  }
26306  }
26307  if (code_line <= entries[mid].code_line) {
26308  return mid;
26309  } else {
26310  return mid + 1;
26311  }
26312 }
26313 static PyCodeObject *__pyx_find_code_object(int code_line) {
26314  PyCodeObject* code_object;
26315  int pos;
26316  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26317  return NULL;
26318  }
26319  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26320  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26321  return NULL;
26322  }
26323  code_object = __pyx_code_cache.entries[pos].code_object;
26324  Py_INCREF(code_object);
26325  return code_object;
26326 }
26327 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26328  int pos, i;
26329  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26330  if (unlikely(!code_line)) {
26331  return;
26332  }
26333  if (unlikely(!entries)) {
26334  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26335  if (likely(entries)) {
26336  __pyx_code_cache.entries = entries;
26337  __pyx_code_cache.max_count = 64;
26338  __pyx_code_cache.count = 1;
26339  entries[0].code_line = code_line;
26340  entries[0].code_object = code_object;
26341  Py_INCREF(code_object);
26342  }
26343  return;
26344  }
26345  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26346  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26347  PyCodeObject* tmp = entries[pos].code_object;
26348  entries[pos].code_object = code_object;
26349  Py_DECREF(tmp);
26350  return;
26351  }
26352  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26353  int new_max = __pyx_code_cache.max_count + 64;
26354  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26355  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26356  if (unlikely(!entries)) {
26357  return;
26358  }
26359  __pyx_code_cache.entries = entries;
26360  __pyx_code_cache.max_count = new_max;
26361  }
26362  for (i=__pyx_code_cache.count; i>pos; i--) {
26363  entries[i] = entries[i-1];
26364  }
26365  entries[pos].code_line = code_line;
26366  entries[pos].code_object = code_object;
26367  __pyx_code_cache.count++;
26368  Py_INCREF(code_object);
26369 }
26370 
26371 /* AddTraceback */
26372 #include "compile.h"
26373 #include "frameobject.h"
26374 #include "traceback.h"
26375 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26376  const char *funcname, int c_line,
26377  int py_line, const char *filename) {
26378  PyCodeObject *py_code = 0;
26379  PyObject *py_srcfile = 0;
26380  PyObject *py_funcname = 0;
26381  #if PY_MAJOR_VERSION < 3
26382  py_srcfile = PyString_FromString(filename);
26383  #else
26384  py_srcfile = PyUnicode_FromString(filename);
26385  #endif
26386  if (!py_srcfile) goto bad;
26387  if (c_line) {
26388  #if PY_MAJOR_VERSION < 3
26389  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26390  #else
26391  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26392  #endif
26393  }
26394  else {
26395  #if PY_MAJOR_VERSION < 3
26396  py_funcname = PyString_FromString(funcname);
26397  #else
26398  py_funcname = PyUnicode_FromString(funcname);
26399  #endif
26400  }
26401  if (!py_funcname) goto bad;
26402  py_code = __Pyx_PyCode_New(
26403  0,
26404  0,
26405  0,
26406  0,
26407  0,
26408  __pyx_empty_bytes, /*PyObject *code,*/
26409  __pyx_empty_tuple, /*PyObject *consts,*/
26410  __pyx_empty_tuple, /*PyObject *names,*/
26411  __pyx_empty_tuple, /*PyObject *varnames,*/
26412  __pyx_empty_tuple, /*PyObject *freevars,*/
26413  __pyx_empty_tuple, /*PyObject *cellvars,*/
26414  py_srcfile, /*PyObject *filename,*/
26415  py_funcname, /*PyObject *name,*/
26416  py_line,
26417  __pyx_empty_bytes /*PyObject *lnotab*/
26418  );
26419  Py_DECREF(py_srcfile);
26420  Py_DECREF(py_funcname);
26421  return py_code;
26422 bad:
26423  Py_XDECREF(py_srcfile);
26424  Py_XDECREF(py_funcname);
26425  return NULL;
26426 }
26427 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26428  int py_line, const char *filename) {
26429  PyCodeObject *py_code = 0;
26430  PyFrameObject *py_frame = 0;
26431  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26432  if (c_line) {
26433  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26434  }
26435  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26436  if (!py_code) {
26437  py_code = __Pyx_CreateCodeObjectForTraceback(
26438  funcname, c_line, py_line, filename);
26439  if (!py_code) goto bad;
26440  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26441  }
26442  py_frame = PyFrame_New(
26443  tstate, /*PyThreadState *tstate,*/
26444  py_code, /*PyCodeObject *code,*/
26445  __pyx_d, /*PyObject *globals,*/
26446  0 /*PyObject *locals*/
26447  );
26448  if (!py_frame) goto bad;
26449  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26450  PyTraceBack_Here(py_frame);
26451 bad:
26452  Py_XDECREF(py_code);
26453  Py_XDECREF(py_frame);
26454 }
26455 
26456 #if PY_MAJOR_VERSION < 3
26457 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26458  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26459  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26460  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26461  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26462  return -1;
26463 }
26464 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26465  PyObject *obj = view->obj;
26466  if (!obj) return;
26467  if (PyObject_CheckBuffer(obj)) {
26468  PyBuffer_Release(view);
26469  return;
26470  }
26471  if ((0)) {}
26472  view->obj = NULL;
26473  Py_DECREF(obj);
26474 }
26475 #endif
26476 
26477 
26478 /* MemviewSliceIsContig */
26479 static int
26480 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26481 {
26482  int i, index, step, start;
26483  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26484  if (order == 'F') {
26485  step = 1;
26486  start = 0;
26487  } else {
26488  step = -1;
26489  start = ndim - 1;
26490  }
26491  for (i = 0; i < ndim; i++) {
26492  index = start + step * i;
26493  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26494  return 0;
26495  itemsize *= mvs.shape[index];
26496  }
26497  return 1;
26498 }
26499 
26500 /* OverlappingSlices */
26501 static void
26502 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26503  void **out_start, void **out_end,
26504  int ndim, size_t itemsize)
26505 {
26506  char *start, *end;
26507  int i;
26508  start = end = slice->data;
26509  for (i = 0; i < ndim; i++) {
26510  Py_ssize_t stride = slice->strides[i];
26511  Py_ssize_t extent = slice->shape[i];
26512  if (extent == 0) {
26513  *out_start = *out_end = start;
26514  return;
26515  } else {
26516  if (stride > 0)
26517  end += stride * (extent - 1);
26518  else
26519  start += stride * (extent - 1);
26520  }
26521  }
26522  *out_start = start;
26523  *out_end = end + itemsize;
26524 }
26525 static int
26526 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26527  __Pyx_memviewslice *slice2,
26528  int ndim, size_t itemsize)
26529 {
26530  void *start1, *end1, *start2, *end2;
26531  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26532  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26533  return (start1 < end2) && (start2 < end1);
26534 }
26535 
26536 /* Capsule */
26537 static CYTHON_INLINE PyObject *
26538 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26539 {
26540  PyObject *cobj;
26541 #if PY_VERSION_HEX >= 0x02070000
26542  cobj = PyCapsule_New(p, sig, NULL);
26543 #else
26544  cobj = PyCObject_FromVoidPtr(p, NULL);
26545 #endif
26546  return cobj;
26547 }
26548 
26549 /* CIntFromPyVerify */
26550 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26551  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26552 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26553  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26554 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26555  {\
26556  func_type value = func_value;\
26557  if (sizeof(target_type) < sizeof(func_type)) {\
26558  if (unlikely(value != (func_type) (target_type) value)) {\
26559  func_type zero = 0;\
26560  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26561  return (target_type) -1;\
26562  if (is_unsigned && unlikely(value < zero))\
26563  goto raise_neg_overflow;\
26564  else\
26565  goto raise_overflow;\
26566  }\
26567  }\
26568  return (target_type) value;\
26569  }
26570 
26571 /* IsLittleEndian */
26572 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26573 {
26574  union {
26575  uint32_t u32;
26576  uint8_t u8[4];
26577  } S;
26578  S.u32 = 0x01020304;
26579  return S.u8[0] == 4;
26580 }
26581 
26582 /* BufferFormatCheck */
26583 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26584  __Pyx_BufFmt_StackElem* stack,
26585  __Pyx_TypeInfo* type) {
26586  stack[0].field = &ctx->root;
26587  stack[0].parent_offset = 0;
26588  ctx->root.type = type;
26589  ctx->root.name = "buffer dtype";
26590  ctx->root.offset = 0;
26591  ctx->head = stack;
26592  ctx->head->field = &ctx->root;
26593  ctx->fmt_offset = 0;
26594  ctx->head->parent_offset = 0;
26595  ctx->new_packmode = '@';
26596  ctx->enc_packmode = '@';
26597  ctx->new_count = 1;
26598  ctx->enc_count = 0;
26599  ctx->enc_type = 0;
26600  ctx->is_complex = 0;
26601  ctx->is_valid_array = 0;
26602  ctx->struct_alignment = 0;
26603  while (type->typegroup == 'S') {
26604  ++ctx->head;
26605  ctx->head->field = type->fields;
26606  ctx->head->parent_offset = 0;
26607  type = type->fields->type;
26608  }
26609 }
26610 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26611  int count;
26612  const char* t = *ts;
26613  if (*t < '0' || *t > '9') {
26614  return -1;
26615  } else {
26616  count = *t++ - '0';
26617  while (*t >= '0' && *t <= '9') {
26618  count *= 10;
26619  count += *t++ - '0';
26620  }
26621  }
26622  *ts = t;
26623  return count;
26624 }
26625 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26626  int number = __Pyx_BufFmt_ParseNumber(ts);
26627  if (number == -1)
26628  PyErr_Format(PyExc_ValueError,\
26629  "Does not understand character buffer dtype format string ('%c')", **ts);
26630  return number;
26631 }
26632 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26633  PyErr_Format(PyExc_ValueError,
26634  "Unexpected format string character: '%c'", ch);
26635 }
26636 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26637  switch (ch) {
26638  case '?': return "'bool'";
26639  case 'c': return "'char'";
26640  case 'b': return "'signed char'";
26641  case 'B': return "'unsigned char'";
26642  case 'h': return "'short'";
26643  case 'H': return "'unsigned short'";
26644  case 'i': return "'int'";
26645  case 'I': return "'unsigned int'";
26646  case 'l': return "'long'";
26647  case 'L': return "'unsigned long'";
26648  case 'q': return "'long long'";
26649  case 'Q': return "'unsigned long long'";
26650  case 'f': return (is_complex ? "'complex float'" : "'float'");
26651  case 'd': return (is_complex ? "'complex double'" : "'double'");
26652  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26653  case 'T': return "a struct";
26654  case 'O': return "Python object";
26655  case 'P': return "a pointer";
26656  case 's': case 'p': return "a string";
26657  case 0: return "end";
26658  default: return "unparseable format string";
26659  }
26660 }
26661 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26662  switch (ch) {
26663  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26664  case 'h': case 'H': return 2;
26665  case 'i': case 'I': case 'l': case 'L': return 4;
26666  case 'q': case 'Q': return 8;
26667  case 'f': return (is_complex ? 8 : 4);
26668  case 'd': return (is_complex ? 16 : 8);
26669  case 'g': {
26670  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26671  return 0;
26672  }
26673  case 'O': case 'P': return sizeof(void*);
26674  default:
26675  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26676  return 0;
26677  }
26678 }
26679 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26680  switch (ch) {
26681  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26682  case 'h': case 'H': return sizeof(short);
26683  case 'i': case 'I': return sizeof(int);
26684  case 'l': case 'L': return sizeof(long);
26685  #ifdef HAVE_LONG_LONG
26686  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26687  #endif
26688  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26689  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26690  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26691  case 'O': case 'P': return sizeof(void*);
26692  default: {
26693  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26694  return 0;
26695  }
26696  }
26697 }
26698 typedef struct { char c; short x; } __Pyx_st_short;
26699 typedef struct { char c; int x; } __Pyx_st_int;
26700 typedef struct { char c; long x; } __Pyx_st_long;
26701 typedef struct { char c; float x; } __Pyx_st_float;
26702 typedef struct { char c; double x; } __Pyx_st_double;
26703 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26704 typedef struct { char c; void *x; } __Pyx_st_void_p;
26705 #ifdef HAVE_LONG_LONG
26706 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26707 #endif
26708 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26709  switch (ch) {
26710  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26711  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26712  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26713  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26714 #ifdef HAVE_LONG_LONG
26715  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26716 #endif
26717  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26718  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26719  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26720  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26721  default:
26722  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26723  return 0;
26724  }
26725 }
26726 /* These are for computing the padding at the end of the struct to align
26727  on the first member of the struct. This will probably the same as above,
26728  but we don't have any guarantees.
26729  */
26730 typedef struct { short x; char c; } __Pyx_pad_short;
26731 typedef struct { int x; char c; } __Pyx_pad_int;
26732 typedef struct { long x; char c; } __Pyx_pad_long;
26733 typedef struct { float x; char c; } __Pyx_pad_float;
26734 typedef struct { double x; char c; } __Pyx_pad_double;
26735 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26736 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26737 #ifdef HAVE_LONG_LONG
26738 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26739 #endif
26740 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26741  switch (ch) {
26742  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26743  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26744  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26745  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26746 #ifdef HAVE_LONG_LONG
26747  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26748 #endif
26749  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26750  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26751  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26752  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26753  default:
26754  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26755  return 0;
26756  }
26757 }
26758 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26759  switch (ch) {
26760  case 'c':
26761  return 'H';
26762  case 'b': case 'h': case 'i':
26763  case 'l': case 'q': case 's': case 'p':
26764  return 'I';
26765  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
26766  return 'U';
26767  case 'f': case 'd': case 'g':
26768  return (is_complex ? 'C' : 'R');
26769  case 'O':
26770  return 'O';
26771  case 'P':
26772  return 'P';
26773  default: {
26774  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26775  return 0;
26776  }
26777  }
26778 }
26779 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26780  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26781  const char* expected;
26782  const char* quote;
26783  if (ctx->head == NULL) {
26784  expected = "end";
26785  quote = "";
26786  } else {
26787  expected = ctx->head->field->type->name;
26788  quote = "'";
26789  }
26790  PyErr_Format(PyExc_ValueError,
26791  "Buffer dtype mismatch, expected %s%s%s but got %s",
26792  quote, expected, quote,
26793  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26794  } else {
26795  __Pyx_StructField* field = ctx->head->field;
26796  __Pyx_StructField* parent = (ctx->head - 1)->field;
26797  PyErr_Format(PyExc_ValueError,
26798  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26799  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26800  parent->type->name, field->name);
26801  }
26802 }
26803 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26804  char group;
26805  size_t size, offset, arraysize = 1;
26806  if (ctx->enc_type == 0) return 0;
26807  if (ctx->head->field->type->arraysize[0]) {
26808  int i, ndim = 0;
26809  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
26810  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26811  ndim = 1;
26812  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26813  PyErr_Format(PyExc_ValueError,
26814  "Expected a dimension of size %zu, got %zu",
26815  ctx->head->field->type->arraysize[0], ctx->enc_count);
26816  return -1;
26817  }
26818  }
26819  if (!ctx->is_valid_array) {
26820  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
26821  ctx->head->field->type->ndim, ndim);
26822  return -1;
26823  }
26824  for (i = 0; i < ctx->head->field->type->ndim; i++) {
26825  arraysize *= ctx->head->field->type->arraysize[i];
26826  }
26827  ctx->is_valid_array = 0;
26828  ctx->enc_count = 1;
26829  }
26830  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26831  do {
26832  __Pyx_StructField* field = ctx->head->field;
26833  __Pyx_TypeInfo* type = field->type;
26834  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
26835  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26836  } else {
26837  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26838  }
26839  if (ctx->enc_packmode == '@') {
26840  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26841  size_t align_mod_offset;
26842  if (align_at == 0) return -1;
26843  align_mod_offset = ctx->fmt_offset % align_at;
26844  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26845  if (ctx->struct_alignment == 0)
26846  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26847  ctx->is_complex);
26848  }
26849  if (type->size != size || type->typegroup != group) {
26850  if (type->typegroup == 'C' && type->fields != NULL) {
26851  size_t parent_offset = ctx->head->parent_offset + field->offset;
26852  ++ctx->head;
26853  ctx->head->field = type->fields;
26854  ctx->head->parent_offset = parent_offset;
26855  continue;
26856  }
26857  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
26858  } else {
26859  __Pyx_BufFmt_RaiseExpected(ctx);
26860  return -1;
26861  }
26862  }
26863  offset = ctx->head->parent_offset + field->offset;
26864  if (ctx->fmt_offset != offset) {
26865  PyErr_Format(PyExc_ValueError,
26866  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
26867  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26868  return -1;
26869  }
26870  ctx->fmt_offset += size;
26871  if (arraysize)
26872  ctx->fmt_offset += (arraysize - 1) * size;
26873  --ctx->enc_count;
26874  while (1) {
26875  if (field == &ctx->root) {
26876  ctx->head = NULL;
26877  if (ctx->enc_count != 0) {
26878  __Pyx_BufFmt_RaiseExpected(ctx);
26879  return -1;
26880  }
26881  break;
26882  }
26883  ctx->head->field = ++field;
26884  if (field->type == NULL) {
26885  --ctx->head;
26886  field = ctx->head->field;
26887  continue;
26888  } else if (field->type->typegroup == 'S') {
26889  size_t parent_offset = ctx->head->parent_offset + field->offset;
26890  if (field->type->fields->type == NULL) continue;
26891  field = field->type->fields;
26892  ++ctx->head;
26893  ctx->head->field = field;
26894  ctx->head->parent_offset = parent_offset;
26895  break;
26896  } else {
26897  break;
26898  }
26899  }
26900  } while (ctx->enc_count);
26901  ctx->enc_type = 0;
26902  ctx->is_complex = 0;
26903  return 0;
26904 }
26905 static PyObject *
26906 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
26907 {
26908  const char *ts = *tsp;
26909  int i = 0, number, ndim;
26910  ++ts;
26911  if (ctx->new_count != 1) {
26912  PyErr_SetString(PyExc_ValueError,
26913  "Cannot handle repeated arrays in format string");
26914  return NULL;
26915  }
26916  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26917  ndim = ctx->head->field->type->ndim;
26918  while (*ts && *ts != ')') {
26919  switch (*ts) {
26920  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
26921  default: break;
26922  }
26923  number = __Pyx_BufFmt_ExpectNumber(&ts);
26924  if (number == -1) return NULL;
26925  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
26926  return PyErr_Format(PyExc_ValueError,
26927  "Expected a dimension of size %zu, got %d",
26928  ctx->head->field->type->arraysize[i], number);
26929  if (*ts != ',' && *ts != ')')
26930  return PyErr_Format(PyExc_ValueError,
26931  "Expected a comma in format string, got '%c'", *ts);
26932  if (*ts == ',') ts++;
26933  i++;
26934  }
26935  if (i != ndim)
26936  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
26937  ctx->head->field->type->ndim, i);
26938  if (!*ts) {
26939  PyErr_SetString(PyExc_ValueError,
26940  "Unexpected end of format string, expected ')'");
26941  return NULL;
26942  }
26943  ctx->is_valid_array = 1;
26944  ctx->new_count = 1;
26945  *tsp = ++ts;
26946  return Py_None;
26947 }
26948 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
26949  int got_Z = 0;
26950  while (1) {
26951  switch(*ts) {
26952  case 0:
26953  if (ctx->enc_type != 0 && ctx->head == NULL) {
26954  __Pyx_BufFmt_RaiseExpected(ctx);
26955  return NULL;
26956  }
26957  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26958  if (ctx->head != NULL) {
26959  __Pyx_BufFmt_RaiseExpected(ctx);
26960  return NULL;
26961  }
26962  return ts;
26963  case ' ':
26964  case '\r':
26965  case '\n':
26966  ++ts;
26967  break;
26968  case '<':
26969  if (!__Pyx_Is_Little_Endian()) {
26970  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
26971  return NULL;
26972  }
26973  ctx->new_packmode = '=';
26974  ++ts;
26975  break;
26976  case '>':
26977  case '!':
26978  if (__Pyx_Is_Little_Endian()) {
26979  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
26980  return NULL;
26981  }
26982  ctx->new_packmode = '=';
26983  ++ts;
26984  break;
26985  case '=':
26986  case '@':
26987  case '^':
26988  ctx->new_packmode = *ts++;
26989  break;
26990  case 'T':
26991  {
26992  const char* ts_after_sub;
26993  size_t i, struct_count = ctx->new_count;
26994  size_t struct_alignment = ctx->struct_alignment;
26995  ctx->new_count = 1;
26996  ++ts;
26997  if (*ts != '{') {
26998  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
26999  return NULL;
27000  }
27001  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27002  ctx->enc_type = 0;
27003  ctx->enc_count = 0;
27004  ctx->struct_alignment = 0;
27005  ++ts;
27006  ts_after_sub = ts;
27007  for (i = 0; i != struct_count; ++i) {
27008  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27009  if (!ts_after_sub) return NULL;
27010  }
27011  ts = ts_after_sub;
27012  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27013  }
27014  break;
27015  case '}':
27016  {
27017  size_t alignment = ctx->struct_alignment;
27018  ++ts;
27019  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27020  ctx->enc_type = 0;
27021  if (alignment && ctx->fmt_offset % alignment) {
27022  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27023  }
27024  }
27025  return ts;
27026  case 'x':
27027  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27028  ctx->fmt_offset += ctx->new_count;
27029  ctx->new_count = 1;
27030  ctx->enc_count = 0;
27031  ctx->enc_type = 0;
27032  ctx->enc_packmode = ctx->new_packmode;
27033  ++ts;
27034  break;
27035  case 'Z':
27036  got_Z = 1;
27037  ++ts;
27038  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27039  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27040  return NULL;
27041  }
27042  CYTHON_FALLTHROUGH;
27043  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27044  case 'l': case 'L': case 'q': case 'Q':
27045  case 'f': case 'd': case 'g':
27046  case 'O': case 'p':
27047  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27048  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27049  ctx->enc_count += ctx->new_count;
27050  ctx->new_count = 1;
27051  got_Z = 0;
27052  ++ts;
27053  break;
27054  }
27055  CYTHON_FALLTHROUGH;
27056  case 's':
27057  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27058  ctx->enc_count = ctx->new_count;
27059  ctx->enc_packmode = ctx->new_packmode;
27060  ctx->enc_type = *ts;
27061  ctx->is_complex = got_Z;
27062  ++ts;
27063  ctx->new_count = 1;
27064  got_Z = 0;
27065  break;
27066  case ':':
27067  ++ts;
27068  while(*ts != ':') ++ts;
27069  ++ts;
27070  break;
27071  case '(':
27072  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27073  break;
27074  default:
27075  {
27076  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27077  if (number == -1) return NULL;
27078  ctx->new_count = (size_t)number;
27079  }
27080  }
27081  }
27082 }
27083 
27084 /* TypeInfoCompare */
27085  static int
27086 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27087 {
27088  int i;
27089  if (!a || !b)
27090  return 0;
27091  if (a == b)
27092  return 1;
27093  if (a->size != b->size || a->typegroup != b->typegroup ||
27094  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27095  if (a->typegroup == 'H' || b->typegroup == 'H') {
27096  return a->size == b->size;
27097  } else {
27098  return 0;
27099  }
27100  }
27101  if (a->ndim) {
27102  for (i = 0; i < a->ndim; i++)
27103  if (a->arraysize[i] != b->arraysize[i])
27104  return 0;
27105  }
27106  if (a->typegroup == 'S') {
27107  if (a->flags != b->flags)
27108  return 0;
27109  if (a->fields || b->fields) {
27110  if (!(a->fields && b->fields))
27111  return 0;
27112  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27113  __Pyx_StructField *field_a = a->fields + i;
27114  __Pyx_StructField *field_b = b->fields + i;
27115  if (field_a->offset != field_b->offset ||
27116  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27117  return 0;
27118  }
27119  return !a->fields[i].type && !b->fields[i].type;
27120  }
27121  }
27122  return 1;
27123 }
27124 
27125 /* MemviewSliceValidateAndInit */
27126  static int
27127 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27128 {
27129  if (buf->shape[dim] <= 1)
27130  return 1;
27131  if (buf->strides) {
27132  if (spec & __Pyx_MEMVIEW_CONTIG) {
27133  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27134  if (unlikely(buf->strides[dim] != sizeof(void *))) {
27135  PyErr_Format(PyExc_ValueError,
27136  "Buffer is not indirectly contiguous "
27137  "in dimension %d.", dim);
27138  goto fail;
27139  }
27140  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27141  PyErr_SetString(PyExc_ValueError,
27142  "Buffer and memoryview are not contiguous "
27143  "in the same dimension.");
27144  goto fail;
27145  }
27146  }
27147  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27148  Py_ssize_t stride = buf->strides[dim];
27149  if (stride < 0)
27150  stride = -stride;
27151  if (unlikely(stride < buf->itemsize)) {
27152  PyErr_SetString(PyExc_ValueError,
27153  "Buffer and memoryview are not contiguous "
27154  "in the same dimension.");
27155  goto fail;
27156  }
27157  }
27158  } else {
27159  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27160  PyErr_Format(PyExc_ValueError,
27161  "C-contiguous buffer is not contiguous in "
27162  "dimension %d", dim);
27163  goto fail;
27164  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27165  PyErr_Format(PyExc_ValueError,
27166  "C-contiguous buffer is not indirect in "
27167  "dimension %d", dim);
27168  goto fail;
27169  } else if (unlikely(buf->suboffsets)) {
27170  PyErr_SetString(PyExc_ValueError,
27171  "Buffer exposes suboffsets but no strides");
27172  goto fail;
27173  }
27174  }
27175  return 1;
27176 fail:
27177  return 0;
27178 }
27179 static int
27180 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27181 {
27182  if (spec & __Pyx_MEMVIEW_DIRECT) {
27183  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27184  PyErr_Format(PyExc_ValueError,
27185  "Buffer not compatible with direct access "
27186  "in dimension %d.", dim);
27187  goto fail;
27188  }
27189  }
27190  if (spec & __Pyx_MEMVIEW_PTR) {
27191  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27192  PyErr_Format(PyExc_ValueError,
27193  "Buffer is not indirectly accessible "
27194  "in dimension %d.", dim);
27195  goto fail;
27196  }
27197  }
27198  return 1;
27199 fail:
27200  return 0;
27201 }
27202 static int
27203 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27204 {
27205  int i;
27206  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27207  Py_ssize_t stride = 1;
27208  for (i = 0; i < ndim; i++) {
27209  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27210  PyErr_SetString(PyExc_ValueError,
27211  "Buffer not fortran contiguous.");
27212  goto fail;
27213  }
27214  stride = stride * buf->shape[i];
27215  }
27216  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27217  Py_ssize_t stride = 1;
27218  for (i = ndim - 1; i >- 1; i--) {
27219  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27220  PyErr_SetString(PyExc_ValueError,
27221  "Buffer not C contiguous.");
27222  goto fail;
27223  }
27224  stride = stride * buf->shape[i];
27225  }
27226  }
27227  return 1;
27228 fail:
27229  return 0;
27230 }
27231 static int __Pyx_ValidateAndInit_memviewslice(
27232  int *axes_specs,
27233  int c_or_f_flag,
27234  int buf_flags,
27235  int ndim,
27236  __Pyx_TypeInfo *dtype,
27237  __Pyx_BufFmt_StackElem stack[],
27238  __Pyx_memviewslice *memviewslice,
27239  PyObject *original_obj)
27240 {
27241  struct __pyx_memoryview_obj *memview, *new_memview;
27242  __Pyx_RefNannyDeclarations
27243  Py_buffer *buf;
27244  int i, spec = 0, retval = -1;
27245  __Pyx_BufFmt_Context ctx;
27246  int from_memoryview = __pyx_memoryview_check(original_obj);
27247  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27248  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27249  original_obj)->typeinfo)) {
27250  memview = (struct __pyx_memoryview_obj *) original_obj;
27251  new_memview = NULL;
27252  } else {
27253  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27254  original_obj, buf_flags, 0, dtype);
27255  new_memview = memview;
27256  if (unlikely(!memview))
27257  goto fail;
27258  }
27259  buf = &memview->view;
27260  if (unlikely(buf->ndim != ndim)) {
27261  PyErr_Format(PyExc_ValueError,
27262  "Buffer has wrong number of dimensions (expected %d, got %d)",
27263  ndim, buf->ndim);
27264  goto fail;
27265  }
27266  if (new_memview) {
27267  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27268  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
27269  }
27270  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
27271  PyErr_Format(PyExc_ValueError,
27272  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27273  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27274  buf->itemsize,
27275  (buf->itemsize > 1) ? "s" : "",
27276  dtype->name,
27277  dtype->size,
27278  (dtype->size > 1) ? "s" : "");
27279  goto fail;
27280  }
27281  if (buf->len > 0) {
27282  for (i = 0; i < ndim; i++) {
27283  spec = axes_specs[i];
27284  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27285  goto fail;
27286  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27287  goto fail;
27288  }
27289  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27290  goto fail;
27291  }
27292  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27293  new_memview != NULL) == -1)) {
27294  goto fail;
27295  }
27296  retval = 0;
27297  goto no_fail;
27298 fail:
27299  Py_XDECREF(new_memview);
27300  retval = -1;
27301 no_fail:
27302  __Pyx_RefNannyFinishContext();
27303  return retval;
27304 }
27305 
27306 /* ObjectToMemviewSlice */
27307  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
27308  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27309  __Pyx_BufFmt_StackElem stack[1];
27310  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27311  int retcode;
27312  if (obj == Py_None) {
27313  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27314  return result;
27315  }
27316  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27317  PyBUF_RECORDS_RO | writable_flag, 1,
27318  &__Pyx_TypeInfo_double, stack,
27319  &result, obj);
27320  if (unlikely(retcode == -1))
27321  goto __pyx_fail;
27322  return result;
27323 __pyx_fail:
27324  result.memview = NULL;
27325  result.data = NULL;
27326  return result;
27327 }
27328 
27329 /* ObjectToMemviewSlice */
27330  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
27331  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27332  __Pyx_BufFmt_StackElem stack[1];
27333  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27334  int retcode;
27335  if (obj == Py_None) {
27336  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27337  return result;
27338  }
27339  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27340  PyBUF_RECORDS_RO | writable_flag, 1,
27341  &__Pyx_TypeInfo_int, stack,
27342  &result, obj);
27343  if (unlikely(retcode == -1))
27344  goto __pyx_fail;
27345  return result;
27346 __pyx_fail:
27347  result.memview = NULL;
27348  result.data = NULL;
27349  return result;
27350 }
27351 
27352 /* Declarations */
27353  #if CYTHON_CCOMPLEX
27354  #ifdef __cplusplus
27355  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27356  return ::std::complex< float >(x, y);
27357  }
27358  #else
27359  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27360  return x + y*(__pyx_t_float_complex)_Complex_I;
27361  }
27362  #endif
27363 #else
27364  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27365  __pyx_t_float_complex z;
27366  z.real = x;
27367  z.imag = y;
27368  return z;
27369  }
27370 #endif
27371 
27372 /* Arithmetic */
27373  #if CYTHON_CCOMPLEX
27374 #else
27375  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27376  return (a.real == b.real) && (a.imag == b.imag);
27377  }
27378  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27379  __pyx_t_float_complex z;
27380  z.real = a.real + b.real;
27381  z.imag = a.imag + b.imag;
27382  return z;
27383  }
27384  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27385  __pyx_t_float_complex z;
27386  z.real = a.real - b.real;
27387  z.imag = a.imag - b.imag;
27388  return z;
27389  }
27390  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27391  __pyx_t_float_complex z;
27392  z.real = a.real * b.real - a.imag * b.imag;
27393  z.imag = a.real * b.imag + a.imag * b.real;
27394  return z;
27395  }
27396  #if 1
27397  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27398  if (b.imag == 0) {
27399  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27400  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27401  if (b.real == 0 && b.imag == 0) {
27402  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27403  } else {
27404  float r = b.imag / b.real;
27405  float s = (float)(1.0) / (b.real + b.imag * r);
27406  return __pyx_t_float_complex_from_parts(
27407  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27408  }
27409  } else {
27410  float r = b.real / b.imag;
27411  float s = (float)(1.0) / (b.imag + b.real * r);
27412  return __pyx_t_float_complex_from_parts(
27413  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27414  }
27415  }
27416  #else
27417  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27418  if (b.imag == 0) {
27419  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27420  } else {
27421  float denom = b.real * b.real + b.imag * b.imag;
27422  return __pyx_t_float_complex_from_parts(
27423  (a.real * b.real + a.imag * b.imag) / denom,
27424  (a.imag * b.real - a.real * b.imag) / denom);
27425  }
27426  }
27427  #endif
27428  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27429  __pyx_t_float_complex z;
27430  z.real = -a.real;
27431  z.imag = -a.imag;
27432  return z;
27433  }
27434  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27435  return (a.real == 0) && (a.imag == 0);
27436  }
27437  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27438  __pyx_t_float_complex z;
27439  z.real = a.real;
27440  z.imag = -a.imag;
27441  return z;
27442  }
27443  #if 1
27444  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27445  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27446  return sqrtf(z.real*z.real + z.imag*z.imag);
27447  #else
27448  return hypotf(z.real, z.imag);
27449  #endif
27450  }
27451  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27452  __pyx_t_float_complex z;
27453  float r, lnr, theta, z_r, z_theta;
27454  if (b.imag == 0 && b.real == (int)b.real) {
27455  if (b.real < 0) {
27456  float denom = a.real * a.real + a.imag * a.imag;
27457  a.real = a.real / denom;
27458  a.imag = -a.imag / denom;
27459  b.real = -b.real;
27460  }
27461  switch ((int)b.real) {
27462  case 0:
27463  z.real = 1;
27464  z.imag = 0;
27465  return z;
27466  case 1:
27467  return a;
27468  case 2:
27469  return __Pyx_c_prod_float(a, a);
27470  case 3:
27471  z = __Pyx_c_prod_float(a, a);
27472  return __Pyx_c_prod_float(z, a);
27473  case 4:
27474  z = __Pyx_c_prod_float(a, a);
27475  return __Pyx_c_prod_float(z, z);
27476  }
27477  }
27478  if (a.imag == 0) {
27479  if (a.real == 0) {
27480  return a;
27481  } else if (b.imag == 0) {
27482  z.real = powf(a.real, b.real);
27483  z.imag = 0;
27484  return z;
27485  } else if (a.real > 0) {
27486  r = a.real;
27487  theta = 0;
27488  } else {
27489  r = -a.real;
27490  theta = atan2f(0.0, -1.0);
27491  }
27492  } else {
27493  r = __Pyx_c_abs_float(a);
27494  theta = atan2f(a.imag, a.real);
27495  }
27496  lnr = logf(r);
27497  z_r = expf(lnr * b.real - theta * b.imag);
27498  z_theta = theta * b.real + lnr * b.imag;
27499  z.real = z_r * cosf(z_theta);
27500  z.imag = z_r * sinf(z_theta);
27501  return z;
27502  }
27503  #endif
27504 #endif
27505 
27506 /* Declarations */
27507  #if CYTHON_CCOMPLEX
27508  #ifdef __cplusplus
27509  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27510  return ::std::complex< double >(x, y);
27511  }
27512  #else
27513  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27514  return x + y*(__pyx_t_double_complex)_Complex_I;
27515  }
27516  #endif
27517 #else
27518  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27519  __pyx_t_double_complex z;
27520  z.real = x;
27521  z.imag = y;
27522  return z;
27523  }
27524 #endif
27525 
27526 /* Arithmetic */
27527  #if CYTHON_CCOMPLEX
27528 #else
27529  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27530  return (a.real == b.real) && (a.imag == b.imag);
27531  }
27532  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27533  __pyx_t_double_complex z;
27534  z.real = a.real + b.real;
27535  z.imag = a.imag + b.imag;
27536  return z;
27537  }
27538  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27539  __pyx_t_double_complex z;
27540  z.real = a.real - b.real;
27541  z.imag = a.imag - b.imag;
27542  return z;
27543  }
27544  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27545  __pyx_t_double_complex z;
27546  z.real = a.real * b.real - a.imag * b.imag;
27547  z.imag = a.real * b.imag + a.imag * b.real;
27548  return z;
27549  }
27550  #if 1
27551  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27552  if (b.imag == 0) {
27553  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27554  } else if (fabs(b.real) >= fabs(b.imag)) {
27555  if (b.real == 0 && b.imag == 0) {
27556  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27557  } else {
27558  double r = b.imag / b.real;
27559  double s = (double)(1.0) / (b.real + b.imag * r);
27560  return __pyx_t_double_complex_from_parts(
27561  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27562  }
27563  } else {
27564  double r = b.real / b.imag;
27565  double s = (double)(1.0) / (b.imag + b.real * r);
27566  return __pyx_t_double_complex_from_parts(
27567  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27568  }
27569  }
27570  #else
27571  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27572  if (b.imag == 0) {
27573  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27574  } else {
27575  double denom = b.real * b.real + b.imag * b.imag;
27576  return __pyx_t_double_complex_from_parts(
27577  (a.real * b.real + a.imag * b.imag) / denom,
27578  (a.imag * b.real - a.real * b.imag) / denom);
27579  }
27580  }
27581  #endif
27582  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27583  __pyx_t_double_complex z;
27584  z.real = -a.real;
27585  z.imag = -a.imag;
27586  return z;
27587  }
27588  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27589  return (a.real == 0) && (a.imag == 0);
27590  }
27591  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27592  __pyx_t_double_complex z;
27593  z.real = a.real;
27594  z.imag = -a.imag;
27595  return z;
27596  }
27597  #if 1
27598  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27599  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27600  return sqrt(z.real*z.real + z.imag*z.imag);
27601  #else
27602  return hypot(z.real, z.imag);
27603  #endif
27604  }
27605  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27606  __pyx_t_double_complex z;
27607  double r, lnr, theta, z_r, z_theta;
27608  if (b.imag == 0 && b.real == (int)b.real) {
27609  if (b.real < 0) {
27610  double denom = a.real * a.real + a.imag * a.imag;
27611  a.real = a.real / denom;
27612  a.imag = -a.imag / denom;
27613  b.real = -b.real;
27614  }
27615  switch ((int)b.real) {
27616  case 0:
27617  z.real = 1;
27618  z.imag = 0;
27619  return z;
27620  case 1:
27621  return a;
27622  case 2:
27623  return __Pyx_c_prod_double(a, a);
27624  case 3:
27625  z = __Pyx_c_prod_double(a, a);
27626  return __Pyx_c_prod_double(z, a);
27627  case 4:
27628  z = __Pyx_c_prod_double(a, a);
27629  return __Pyx_c_prod_double(z, z);
27630  }
27631  }
27632  if (a.imag == 0) {
27633  if (a.real == 0) {
27634  return a;
27635  } else if (b.imag == 0) {
27636  z.real = pow(a.real, b.real);
27637  z.imag = 0;
27638  return z;
27639  } else if (a.real > 0) {
27640  r = a.real;
27641  theta = 0;
27642  } else {
27643  r = -a.real;
27644  theta = atan2(0.0, -1.0);
27645  }
27646  } else {
27647  r = __Pyx_c_abs_double(a);
27648  theta = atan2(a.imag, a.real);
27649  }
27650  lnr = log(r);
27651  z_r = exp(lnr * b.real - theta * b.imag);
27652  z_theta = theta * b.real + lnr * b.imag;
27653  z.real = z_r * cos(z_theta);
27654  z.imag = z_r * sin(z_theta);
27655  return z;
27656  }
27657  #endif
27658 #endif
27659 
27660 /* MemviewSliceCopyTemplate */
27661  static __Pyx_memviewslice
27662 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27663  const char *mode, int ndim,
27664  size_t sizeof_dtype, int contig_flag,
27665  int dtype_is_object)
27666 {
27667  __Pyx_RefNannyDeclarations
27668  int i;
27669  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27670  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27671  Py_buffer *buf = &from_memview->view;
27672  PyObject *shape_tuple = NULL;
27673  PyObject *temp_int = NULL;
27674  struct __pyx_array_obj *array_obj = NULL;
27675  struct __pyx_memoryview_obj *memview_obj = NULL;
27676  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27677  for (i = 0; i < ndim; i++) {
27678  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27679  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27680  "indirect dimensions (axis %d)", i);
27681  goto fail;
27682  }
27683  }
27684  shape_tuple = PyTuple_New(ndim);
27685  if (unlikely(!shape_tuple)) {
27686  goto fail;
27687  }
27688  __Pyx_GOTREF(shape_tuple);
27689  for(i = 0; i < ndim; i++) {
27690  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27691  if(unlikely(!temp_int)) {
27692  goto fail;
27693  } else {
27694  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27695  temp_int = NULL;
27696  }
27697  }
27698  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27699  if (unlikely(!array_obj)) {
27700  goto fail;
27701  }
27702  __Pyx_GOTREF(array_obj);
27703  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27704  (PyObject *) array_obj, contig_flag,
27705  dtype_is_object,
27706  from_mvs->memview->typeinfo);
27707  if (unlikely(!memview_obj))
27708  goto fail;
27709  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27710  goto fail;
27711  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27712  dtype_is_object) < 0))
27713  goto fail;
27714  goto no_fail;
27715 fail:
27716  __Pyx_XDECREF(new_mvs.memview);
27717  new_mvs.memview = NULL;
27718  new_mvs.data = NULL;
27719 no_fail:
27720  __Pyx_XDECREF(shape_tuple);
27721  __Pyx_XDECREF(temp_int);
27722  __Pyx_XDECREF(array_obj);
27723  __Pyx_RefNannyFinishContext();
27724  return new_mvs;
27725 }
27726 
27727 /* CIntFromPy */
27728  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27729 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27730 #pragma GCC diagnostic push
27731 #pragma GCC diagnostic ignored "-Wconversion"
27732 #endif
27733  const int neg_one = (int) -1, const_zero = (int) 0;
27734 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27735 #pragma GCC diagnostic pop
27736 #endif
27737  const int is_unsigned = neg_one > const_zero;
27738 #if PY_MAJOR_VERSION < 3
27739  if (likely(PyInt_Check(x))) {
27740  if (sizeof(int) < sizeof(long)) {
27741  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27742  } else {
27743  long val = PyInt_AS_LONG(x);
27744  if (is_unsigned && unlikely(val < 0)) {
27745  goto raise_neg_overflow;
27746  }
27747  return (int) val;
27748  }
27749  } else
27750 #endif
27751  if (likely(PyLong_Check(x))) {
27752  if (is_unsigned) {
27753 #if CYTHON_USE_PYLONG_INTERNALS
27754  const digit* digits = ((PyLongObject*)x)->ob_digit;
27755  switch (Py_SIZE(x)) {
27756  case 0: return (int) 0;
27757  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27758  case 2:
27759  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27760  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27761  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27762  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27763  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27764  }
27765  }
27766  break;
27767  case 3:
27768  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27769  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27770  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27771  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27772  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27773  }
27774  }
27775  break;
27776  case 4:
27777  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27778  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27779  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27780  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27781  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27782  }
27783  }
27784  break;
27785  }
27786 #endif
27787 #if CYTHON_COMPILING_IN_CPYTHON
27788  if (unlikely(Py_SIZE(x) < 0)) {
27789  goto raise_neg_overflow;
27790  }
27791 #else
27792  {
27793  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27794  if (unlikely(result < 0))
27795  return (int) -1;
27796  if (unlikely(result == 1))
27797  goto raise_neg_overflow;
27798  }
27799 #endif
27800  if (sizeof(int) <= sizeof(unsigned long)) {
27801  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27802 #ifdef HAVE_LONG_LONG
27803  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27804  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27805 #endif
27806  }
27807  } else {
27808 #if CYTHON_USE_PYLONG_INTERNALS
27809  const digit* digits = ((PyLongObject*)x)->ob_digit;
27810  switch (Py_SIZE(x)) {
27811  case 0: return (int) 0;
27812  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27813  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27814  case -2:
27815  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27816  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27817  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27818  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27819  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27820  }
27821  }
27822  break;
27823  case 2:
27824  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27825  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27826  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27827  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27828  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27829  }
27830  }
27831  break;
27832  case -3:
27833  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27834  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27835  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27836  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27837  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27838  }
27839  }
27840  break;
27841  case 3:
27842  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27843  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27844  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27845  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27846  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27847  }
27848  }
27849  break;
27850  case -4:
27851  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27852  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27853  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27854  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27855  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27856  }
27857  }
27858  break;
27859  case 4:
27860  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27861  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27862  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27863  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27864  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27865  }
27866  }
27867  break;
27868  }
27869 #endif
27870  if (sizeof(int) <= sizeof(long)) {
27871  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
27872 #ifdef HAVE_LONG_LONG
27873  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27874  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
27875 #endif
27876  }
27877  }
27878  {
27879 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27880  PyErr_SetString(PyExc_RuntimeError,
27881  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27882 #else
27883  int val;
27884  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27885  #if PY_MAJOR_VERSION < 3
27886  if (likely(v) && !PyLong_Check(v)) {
27887  PyObject *tmp = v;
27888  v = PyNumber_Long(tmp);
27889  Py_DECREF(tmp);
27890  }
27891  #endif
27892  if (likely(v)) {
27893  int one = 1; int is_little = (int)*(unsigned char *)&one;
27894  unsigned char *bytes = (unsigned char *)&val;
27895  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27896  bytes, sizeof(val),
27897  is_little, !is_unsigned);
27898  Py_DECREF(v);
27899  if (likely(!ret))
27900  return val;
27901  }
27902 #endif
27903  return (int) -1;
27904  }
27905  } else {
27906  int val;
27907  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27908  if (!tmp) return (int) -1;
27909  val = __Pyx_PyInt_As_int(tmp);
27910  Py_DECREF(tmp);
27911  return val;
27912  }
27913 raise_overflow:
27914  PyErr_SetString(PyExc_OverflowError,
27915  "value too large to convert to int");
27916  return (int) -1;
27917 raise_neg_overflow:
27918  PyErr_SetString(PyExc_OverflowError,
27919  "can't convert negative value to int");
27920  return (int) -1;
27921 }
27922 
27923 /* CIntFromPy */
27924  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27925 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27926 #pragma GCC diagnostic push
27927 #pragma GCC diagnostic ignored "-Wconversion"
27928 #endif
27929  const long neg_one = (long) -1, const_zero = (long) 0;
27930 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27931 #pragma GCC diagnostic pop
27932 #endif
27933  const int is_unsigned = neg_one > const_zero;
27934 #if PY_MAJOR_VERSION < 3
27935  if (likely(PyInt_Check(x))) {
27936  if (sizeof(long) < sizeof(long)) {
27937  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27938  } else {
27939  long val = PyInt_AS_LONG(x);
27940  if (is_unsigned && unlikely(val < 0)) {
27941  goto raise_neg_overflow;
27942  }
27943  return (long) val;
27944  }
27945  } else
27946 #endif
27947  if (likely(PyLong_Check(x))) {
27948  if (is_unsigned) {
27949 #if CYTHON_USE_PYLONG_INTERNALS
27950  const digit* digits = ((PyLongObject*)x)->ob_digit;
27951  switch (Py_SIZE(x)) {
27952  case 0: return (long) 0;
27953  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27954  case 2:
27955  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27956  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27957  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27958  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27959  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27960  }
27961  }
27962  break;
27963  case 3:
27964  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27965  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27966  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27967  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27968  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27969  }
27970  }
27971  break;
27972  case 4:
27973  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27974  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27975  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27976  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27977  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27978  }
27979  }
27980  break;
27981  }
27982 #endif
27983 #if CYTHON_COMPILING_IN_CPYTHON
27984  if (unlikely(Py_SIZE(x) < 0)) {
27985  goto raise_neg_overflow;
27986  }
27987 #else
27988  {
27989  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27990  if (unlikely(result < 0))
27991  return (long) -1;
27992  if (unlikely(result == 1))
27993  goto raise_neg_overflow;
27994  }
27995 #endif
27996  if (sizeof(long) <= sizeof(unsigned long)) {
27997  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27998 #ifdef HAVE_LONG_LONG
27999  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28000  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28001 #endif
28002  }
28003  } else {
28004 #if CYTHON_USE_PYLONG_INTERNALS
28005  const digit* digits = ((PyLongObject*)x)->ob_digit;
28006  switch (Py_SIZE(x)) {
28007  case 0: return (long) 0;
28008  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28009  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28010  case -2:
28011  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28012  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28013  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28014  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28015  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28016  }
28017  }
28018  break;
28019  case 2:
28020  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28021  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28022  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28023  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28024  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28025  }
28026  }
28027  break;
28028  case -3:
28029  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28030  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28031  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28032  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28033  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28034  }
28035  }
28036  break;
28037  case 3:
28038  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28039  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28040  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28041  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28042  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28043  }
28044  }
28045  break;
28046  case -4:
28047  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28048  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28049  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28050  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28051  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28052  }
28053  }
28054  break;
28055  case 4:
28056  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28057  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28058  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28059  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28060  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28061  }
28062  }
28063  break;
28064  }
28065 #endif
28066  if (sizeof(long) <= sizeof(long)) {
28067  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28068 #ifdef HAVE_LONG_LONG
28069  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28070  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28071 #endif
28072  }
28073  }
28074  {
28075 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28076  PyErr_SetString(PyExc_RuntimeError,
28077  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28078 #else
28079  long val;
28080  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28081  #if PY_MAJOR_VERSION < 3
28082  if (likely(v) && !PyLong_Check(v)) {
28083  PyObject *tmp = v;
28084  v = PyNumber_Long(tmp);
28085  Py_DECREF(tmp);
28086  }
28087  #endif
28088  if (likely(v)) {
28089  int one = 1; int is_little = (int)*(unsigned char *)&one;
28090  unsigned char *bytes = (unsigned char *)&val;
28091  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28092  bytes, sizeof(val),
28093  is_little, !is_unsigned);
28094  Py_DECREF(v);
28095  if (likely(!ret))
28096  return val;
28097  }
28098 #endif
28099  return (long) -1;
28100  }
28101  } else {
28102  long val;
28103  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28104  if (!tmp) return (long) -1;
28105  val = __Pyx_PyInt_As_long(tmp);
28106  Py_DECREF(tmp);
28107  return val;
28108  }
28109 raise_overflow:
28110  PyErr_SetString(PyExc_OverflowError,
28111  "value too large to convert to long");
28112  return (long) -1;
28113 raise_neg_overflow:
28114  PyErr_SetString(PyExc_OverflowError,
28115  "can't convert negative value to long");
28116  return (long) -1;
28117 }
28118 
28119 /* CIntToPy */
28120  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28121 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28122 #pragma GCC diagnostic push
28123 #pragma GCC diagnostic ignored "-Wconversion"
28124 #endif
28125  const int neg_one = (int) -1, const_zero = (int) 0;
28126 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28127 #pragma GCC diagnostic pop
28128 #endif
28129  const int is_unsigned = neg_one > const_zero;
28130  if (is_unsigned) {
28131  if (sizeof(int) < sizeof(long)) {
28132  return PyInt_FromLong((long) value);
28133  } else if (sizeof(int) <= sizeof(unsigned long)) {
28134  return PyLong_FromUnsignedLong((unsigned long) value);
28135 #ifdef HAVE_LONG_LONG
28136  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28137  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28138 #endif
28139  }
28140  } else {
28141  if (sizeof(int) <= sizeof(long)) {
28142  return PyInt_FromLong((long) value);
28143 #ifdef HAVE_LONG_LONG
28144  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28145  return PyLong_FromLongLong((PY_LONG_LONG) value);
28146 #endif
28147  }
28148  }
28149  {
28150  int one = 1; int little = (int)*(unsigned char *)&one;
28151  unsigned char *bytes = (unsigned char *)&value;
28152  return _PyLong_FromByteArray(bytes, sizeof(int),
28153  little, !is_unsigned);
28154  }
28155 }
28156 
28157 /* CIntToPy */
28158  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28159 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28160 #pragma GCC diagnostic push
28161 #pragma GCC diagnostic ignored "-Wconversion"
28162 #endif
28163  const long neg_one = (long) -1, const_zero = (long) 0;
28164 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28165 #pragma GCC diagnostic pop
28166 #endif
28167  const int is_unsigned = neg_one > const_zero;
28168  if (is_unsigned) {
28169  if (sizeof(long) < sizeof(long)) {
28170  return PyInt_FromLong((long) value);
28171  } else if (sizeof(long) <= sizeof(unsigned long)) {
28172  return PyLong_FromUnsignedLong((unsigned long) value);
28173 #ifdef HAVE_LONG_LONG
28174  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28175  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28176 #endif
28177  }
28178  } else {
28179  if (sizeof(long) <= sizeof(long)) {
28180  return PyInt_FromLong((long) value);
28181 #ifdef HAVE_LONG_LONG
28182  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28183  return PyLong_FromLongLong((PY_LONG_LONG) value);
28184 #endif
28185  }
28186  }
28187  {
28188  int one = 1; int little = (int)*(unsigned char *)&one;
28189  unsigned char *bytes = (unsigned char *)&value;
28190  return _PyLong_FromByteArray(bytes, sizeof(long),
28191  little, !is_unsigned);
28192  }
28193 }
28194 
28195 /* CIntFromPy */
28196  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28197 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28198 #pragma GCC diagnostic push
28199 #pragma GCC diagnostic ignored "-Wconversion"
28200 #endif
28201  const char neg_one = (char) -1, const_zero = (char) 0;
28202 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28203 #pragma GCC diagnostic pop
28204 #endif
28205  const int is_unsigned = neg_one > const_zero;
28206 #if PY_MAJOR_VERSION < 3
28207  if (likely(PyInt_Check(x))) {
28208  if (sizeof(char) < sizeof(long)) {
28209  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28210  } else {
28211  long val = PyInt_AS_LONG(x);
28212  if (is_unsigned && unlikely(val < 0)) {
28213  goto raise_neg_overflow;
28214  }
28215  return (char) val;
28216  }
28217  } else
28218 #endif
28219  if (likely(PyLong_Check(x))) {
28220  if (is_unsigned) {
28221 #if CYTHON_USE_PYLONG_INTERNALS
28222  const digit* digits = ((PyLongObject*)x)->ob_digit;
28223  switch (Py_SIZE(x)) {
28224  case 0: return (char) 0;
28225  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28226  case 2:
28227  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28228  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28229  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28230  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28231  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28232  }
28233  }
28234  break;
28235  case 3:
28236  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28237  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28238  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28239  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28240  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28241  }
28242  }
28243  break;
28244  case 4:
28245  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28246  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28247  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28248  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28249  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28250  }
28251  }
28252  break;
28253  }
28254 #endif
28255 #if CYTHON_COMPILING_IN_CPYTHON
28256  if (unlikely(Py_SIZE(x) < 0)) {
28257  goto raise_neg_overflow;
28258  }
28259 #else
28260  {
28261  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28262  if (unlikely(result < 0))
28263  return (char) -1;
28264  if (unlikely(result == 1))
28265  goto raise_neg_overflow;
28266  }
28267 #endif
28268  if (sizeof(char) <= sizeof(unsigned long)) {
28269  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28270 #ifdef HAVE_LONG_LONG
28271  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28272  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28273 #endif
28274  }
28275  } else {
28276 #if CYTHON_USE_PYLONG_INTERNALS
28277  const digit* digits = ((PyLongObject*)x)->ob_digit;
28278  switch (Py_SIZE(x)) {
28279  case 0: return (char) 0;
28280  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28281  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28282  case -2:
28283  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28284  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28285  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28286  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28287  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28288  }
28289  }
28290  break;
28291  case 2:
28292  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28293  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28294  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28295  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28296  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28297  }
28298  }
28299  break;
28300  case -3:
28301  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28302  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28303  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28304  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28305  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28306  }
28307  }
28308  break;
28309  case 3:
28310  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28311  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28312  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28313  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28314  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28315  }
28316  }
28317  break;
28318  case -4:
28319  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28320  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28321  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28322  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28323  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28324  }
28325  }
28326  break;
28327  case 4:
28328  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28329  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28330  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28331  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28332  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28333  }
28334  }
28335  break;
28336  }
28337 #endif
28338  if (sizeof(char) <= sizeof(long)) {
28339  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28340 #ifdef HAVE_LONG_LONG
28341  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28342  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28343 #endif
28344  }
28345  }
28346  {
28347 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28348  PyErr_SetString(PyExc_RuntimeError,
28349  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28350 #else
28351  char val;
28352  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28353  #if PY_MAJOR_VERSION < 3
28354  if (likely(v) && !PyLong_Check(v)) {
28355  PyObject *tmp = v;
28356  v = PyNumber_Long(tmp);
28357  Py_DECREF(tmp);
28358  }
28359  #endif
28360  if (likely(v)) {
28361  int one = 1; int is_little = (int)*(unsigned char *)&one;
28362  unsigned char *bytes = (unsigned char *)&val;
28363  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28364  bytes, sizeof(val),
28365  is_little, !is_unsigned);
28366  Py_DECREF(v);
28367  if (likely(!ret))
28368  return val;
28369  }
28370 #endif
28371  return (char) -1;
28372  }
28373  } else {
28374  char val;
28375  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28376  if (!tmp) return (char) -1;
28377  val = __Pyx_PyInt_As_char(tmp);
28378  Py_DECREF(tmp);
28379  return val;
28380  }
28381 raise_overflow:
28382  PyErr_SetString(PyExc_OverflowError,
28383  "value too large to convert to char");
28384  return (char) -1;
28385 raise_neg_overflow:
28386  PyErr_SetString(PyExc_OverflowError,
28387  "can't convert negative value to char");
28388  return (char) -1;
28389 }
28390 
28391 /* CheckBinaryVersion */
28392  static int __Pyx_check_binary_version(void) {
28393  char ctversion[4], rtversion[4];
28394  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28395  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
28396  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28397  char message[200];
28398  PyOS_snprintf(message, sizeof(message),
28399  "compiletime version %s of module '%.100s' "
28400  "does not match runtime version %s",
28401  ctversion, __Pyx_MODULE_NAME, rtversion);
28402  return PyErr_WarnEx(NULL, message, 1);
28403  }
28404  return 0;
28405 }
28406 
28407 /* InitStrings */
28408  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28409  while (t->p) {
28410  #if PY_MAJOR_VERSION < 3
28411  if (t->is_unicode) {
28412  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28413  } else if (t->intern) {
28414  *t->p = PyString_InternFromString(t->s);
28415  } else {
28416  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28417  }
28418  #else
28419  if (t->is_unicode | t->is_str) {
28420  if (t->intern) {
28421  *t->p = PyUnicode_InternFromString(t->s);
28422  } else if (t->encoding) {
28423  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28424  } else {
28425  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28426  }
28427  } else {
28428  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28429  }
28430  #endif
28431  if (!*t->p)
28432  return -1;
28433  if (PyObject_Hash(*t->p) == -1)
28434  return -1;
28435  ++t;
28436  }
28437  return 0;
28438 }
28439 
28440 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
28441  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28442 }
28443 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28444  Py_ssize_t ignore;
28445  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28446 }
28447 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28448 #if !CYTHON_PEP393_ENABLED
28449 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28450  char* defenc_c;
28451  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28452  if (!defenc) return NULL;
28453  defenc_c = PyBytes_AS_STRING(defenc);
28454 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28455  {
28456  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28457  char* c;
28458  for (c = defenc_c; c < end; c++) {
28459  if ((unsigned char) (*c) >= 128) {
28460  PyUnicode_AsASCIIString(o);
28461  return NULL;
28462  }
28463  }
28464  }
28465 #endif
28466  *length = PyBytes_GET_SIZE(defenc);
28467  return defenc_c;
28468 }
28469 #else
28470 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28471  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
28472 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28473  if (likely(PyUnicode_IS_ASCII(o))) {
28474  *length = PyUnicode_GET_LENGTH(o);
28475  return PyUnicode_AsUTF8(o);
28476  } else {
28477  PyUnicode_AsASCIIString(o);
28478  return NULL;
28479  }
28480 #else
28481  return PyUnicode_AsUTF8AndSize(o, length);
28482 #endif
28483 }
28484 #endif
28485 #endif
28486 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28487 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28488  if (
28489 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28490  __Pyx_sys_getdefaultencoding_not_ascii &&
28491 #endif
28492  PyUnicode_Check(o)) {
28493  return __Pyx_PyUnicode_AsStringAndSize(o, length);
28494  } else
28495 #endif
28496 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28497  if (PyByteArray_Check(o)) {
28498  *length = PyByteArray_GET_SIZE(o);
28499  return PyByteArray_AS_STRING(o);
28500  } else
28501 #endif
28502  {
28503  char* result;
28504  int r = PyBytes_AsStringAndSize(o, &result, length);
28505  if (unlikely(r < 0)) {
28506  return NULL;
28507  } else {
28508  return result;
28509  }
28510  }
28511 }
28512 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
28513  int is_true = x == Py_True;
28514  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
28515  else return PyObject_IsTrue(x);
28516 }
28517 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28518  int retval;
28519  if (unlikely(!x)) return -1;
28520  retval = __Pyx_PyObject_IsTrue(x);
28521  Py_DECREF(x);
28522  return retval;
28523 }
28524 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
28525 #if PY_MAJOR_VERSION >= 3
28526  if (PyLong_Check(result)) {
28527  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28528  "__int__ returned non-int (type %.200s). "
28529  "The ability to return an instance of a strict subclass of int "
28530  "is deprecated, and may be removed in a future version of Python.",
28531  Py_TYPE(result)->tp_name)) {
28532  Py_DECREF(result);
28533  return NULL;
28534  }
28535  return result;
28536  }
28537 #endif
28538  PyErr_Format(PyExc_TypeError,
28539  "__%.4s__ returned non-%.4s (type %.200s)",
28540  type_name, type_name, Py_TYPE(result)->tp_name);
28541  Py_DECREF(result);
28542  return NULL;
28543 }
28544 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28545 #if CYTHON_USE_TYPE_SLOTS
28546  PyNumberMethods *m;
28547 #endif
28548  const char *name = NULL;
28549  PyObject *res = NULL;
28550 #if PY_MAJOR_VERSION < 3
28551  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28552 #else
28553  if (likely(PyLong_Check(x)))
28554 #endif
28555  return __Pyx_NewRef(x);
28556 #if CYTHON_USE_TYPE_SLOTS
28557  m = Py_TYPE(x)->tp_as_number;
28558  #if PY_MAJOR_VERSION < 3
28559  if (m && m->nb_int) {
28560  name = "int";
28561  res = m->nb_int(x);
28562  }
28563  else if (m && m->nb_long) {
28564  name = "long";
28565  res = m->nb_long(x);
28566  }
28567  #else
28568  if (likely(m && m->nb_int)) {
28569  name = "int";
28570  res = m->nb_int(x);
28571  }
28572  #endif
28573 #else
28574  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28575  res = PyNumber_Int(x);
28576  }
28577 #endif
28578  if (likely(res)) {
28579 #if PY_MAJOR_VERSION < 3
28580  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28581 #else
28582  if (unlikely(!PyLong_CheckExact(res))) {
28583 #endif
28584  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28585  }
28586  }
28587  else if (!PyErr_Occurred()) {
28588  PyErr_SetString(PyExc_TypeError,
28589  "an integer is required");
28590  }
28591  return res;
28592 }
28593 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28594  Py_ssize_t ival;
28595  PyObject *x;
28596 #if PY_MAJOR_VERSION < 3
28597  if (likely(PyInt_CheckExact(b))) {
28598  if (sizeof(Py_ssize_t) >= sizeof(long))
28599  return PyInt_AS_LONG(b);
28600  else
28601  return PyInt_AsSsize_t(b);
28602  }
28603 #endif
28604  if (likely(PyLong_CheckExact(b))) {
28605  #if CYTHON_USE_PYLONG_INTERNALS
28606  const digit* digits = ((PyLongObject*)b)->ob_digit;
28607  const Py_ssize_t size = Py_SIZE(b);
28608  if (likely(__Pyx_sst_abs(size) <= 1)) {
28609  ival = likely(size) ? digits[0] : 0;
28610  if (size == -1) ival = -ival;
28611  return ival;
28612  } else {
28613  switch (size) {
28614  case 2:
28615  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28616  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28617  }
28618  break;
28619  case -2:
28620  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28621  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28622  }
28623  break;
28624  case 3:
28625  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28626  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28627  }
28628  break;
28629  case -3:
28630  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28631  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28632  }
28633  break;
28634  case 4:
28635  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28636  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28637  }
28638  break;
28639  case -4:
28640  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28641  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28642  }
28643  break;
28644  }
28645  }
28646  #endif
28647  return PyLong_AsSsize_t(b);
28648  }
28649  x = PyNumber_Index(b);
28650  if (!x) return -1;
28651  ival = PyInt_AsSsize_t(x);
28652  Py_DECREF(x);
28653  return ival;
28654 }
28655 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28656  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28657 }
28658 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28659  return PyInt_FromSize_t(ival);
28660 }
28661 
28662 
28663 #endif /* Py_PYTHON_H */
asm_NR_prepare
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:293
jacobi_NR_prepare
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:10
basm_NR_prepare
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:602
smoothers.h
C implementations of multilevel smoother algorithms.
jacobi_NR_solve
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:15
gauss_seidel_NR_prepare
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:71
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
asm_NR_free
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
Definition: smoothers.c:268
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
basm_NR_init
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
Definition: smoothers.c:391
asm_NR_init
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
Definition: smoothers.c:189
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
asm_NR_solve
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:324
basm_NR_free
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)
Definition: smoothers.c:574
proteus_superlu.h
nl_gauss_seidel_NR_solve
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:142
nl_jacobi_NR_solve
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:26
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
gauss_seidel_NR_solve
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:114
basm_NR_solve
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:668
nnz
#define nnz
Definition: Richards.h:9